Debian Codegraph @

execution/func_ends_with_test.go

raw symbols SCIP
1 package execution_test
2
3 import (
4 "testing"
5
6 "github.com/tomwright/dasel/v3/model"
7 )
8
9 func TestFuncEndsWith(t *testing.T) {
10 t.Run("chained true", testCase{
11 s: `"hello world".endsWith("world")`,
12 out: model.NewBoolValue(true),
13 }.run)
14 t.Run("chained false", testCase{
15 s: `"hello world".endsWith("hello")`,
16 out: model.NewBoolValue(false),
17 }.run)
18 t.Run("arg input", testCase{
19 s: `endsWith("hello world", "world")`,
20 out: model.NewBoolValue(true),
21 }.run)
22 t.Run("empty suffix", testCase{
23 s: `"hello".endsWith("")`,
24 out: model.NewBoolValue(true),
25 }.run)
26 }