GetFloat, SetFloat now return error type on error

GetString, SetString now return error type on error

SendText now returns error type on error

remote_test updated.
This commit is contained in:
onyx-and-iris
2022-09-18 05:35:04 +01:00
parent e16a51c0da
commit 00f66e8f9e
2 changed files with 31 additions and 16 deletions

View File

@@ -87,18 +87,21 @@ func TestGetPotatoRemote(t *testing.T) {
func TestSetAndGetFloatParameter(t *testing.T) {
//t.Skip("skipping test")
var param = "strip[0].mute"
var exp = float64(1)
vm.SetFloat(param, 1)
t.Run("Should get a float parameter", func(t *testing.T) {
assert.Equal(t, float64(1), vm.GetFloat(param))
val, _ := vm.GetFloat(param)
assert.Equal(t, exp, val)
})
}
func TestSetAndGetStringParameter(t *testing.T) {
//t.Skip("skipping test")
var param = "strip[0].label"
var val = "test0"
vm.SetString(param, val)
var exp = "test0"
vm.SetString(param, exp)
t.Run("Should get a string parameter", func(t *testing.T) {
assert.Equal(t, val, vm.GetString(param))
val, _ := vm.GetString(param)
assert.Equal(t, exp, val)
})
}