mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
23 lines
455 B
Go
23 lines
455 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
var getValueTests = []struct {
|
||
|
argument string
|
||
|
expectedResult interface{}
|
||
|
testDescription string
|
||
|
}{
|
||
|
{"true", true, "boolean"},
|
||
|
{"\"true\"", "true", "boolean as string"},
|
||
|
{"3.4", 3.4, "number"},
|
||
|
{"\"3.4\"", "3.4", "number as string"},
|
||
|
}
|
||
|
|
||
|
func TestGetValue(t *testing.T) {
|
||
|
for _, tt := range getValueTests {
|
||
|
assertResultWithContext(t, tt.expectedResult, getValue(tt.argument), tt.testDescription)
|
||
|
}
|
||
|
}
|