mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
32 lines
568 B
Go
32 lines
568 B
Go
|
package yqlib
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
var fileOperatorScenarios = []expressionScenario{
|
||
|
{
|
||
|
description: "Get filename",
|
||
|
document: `{}`,
|
||
|
expression: `filename`,
|
||
|
expected: []string{
|
||
|
"D0, P[], (!!str)::sample.yml\n",
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
description: "Get file index",
|
||
|
document: `{}`,
|
||
|
expression: `fileIndex`,
|
||
|
expected: []string{
|
||
|
"D0, P[], (!!int)::0\n",
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func TestFileOperatorsScenarios(t *testing.T) {
|
||
|
for _, tt := range fileOperatorScenarios {
|
||
|
testScenario(t, &tt)
|
||
|
}
|
||
|
documentScenarios(t, "File Operators", fileOperatorScenarios)
|
||
|
}
|