You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
465 B
22 lines
465 B
package data |
|
|
|
import ( |
|
"testing" |
|
) |
|
|
|
func TestCachedString(t *testing.T) { |
|
const testKey = "test string key" |
|
const testValue = "test string value" |
|
|
|
_datastore.SetCachedValue(testKey, []byte(testValue)) |
|
|
|
// Get the config entry from the database |
|
stringTestResult, err := _datastore.GetCachedValue(testKey) |
|
if err != nil { |
|
panic(err) |
|
} |
|
|
|
if string(stringTestResult) != testValue { |
|
t.Error("expected", testValue, "but test returned", stringTestResult) |
|
} |
|
}
|
|
|