mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
23 lines
465 B
Go
23 lines
465 B
Go
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)
|
|
}
|
|
}
|