mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
57 lines
882 B
Go
57 lines
882 B
Go
package treeops
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
var notOperatorScenarios = []expressionScenario{
|
|
{
|
|
document: `cat`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::false\n",
|
|
},
|
|
},
|
|
{
|
|
document: `1`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::false\n",
|
|
},
|
|
},
|
|
{
|
|
document: `0`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::false\n",
|
|
},
|
|
},
|
|
{
|
|
document: `~`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::true\n",
|
|
},
|
|
},
|
|
{
|
|
document: `false`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::true\n",
|
|
},
|
|
},
|
|
{
|
|
document: `true`,
|
|
expression: `. | not`,
|
|
expected: []string{
|
|
"D0, P[], (!!bool)::false\n",
|
|
},
|
|
},
|
|
}
|
|
|
|
func TestNotOperatorScenarios(t *testing.T) {
|
|
for _, tt := range notOperatorScenarios {
|
|
testScenario(t, &tt)
|
|
}
|
|
}
|