MCPcopy
hub / github.com/TomWright/dasel / TestOptions

Function TestOptions

execution/options_test.go:9–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestOptions(t *testing.T) {
10 t.Run("WithFuncs", func(t *testing.T) {
11 fc := execution.DefaultFuncCollection.Copy()
12 opts := execution.NewOptions(execution.WithFuncs(fc))
13 if _, ok := opts.Funcs.Get("len"); !ok {
14 t.Error("expected funcs to contain 'len'")
15 }
16 })
17
18 t.Run("WithoutUnstable", func(t *testing.T) {
19 opts := execution.NewOptions(execution.WithUnstable(), execution.WithoutUnstable())
20 if opts.Unstable {
21 t.Error("expected unstable to be false")
22 }
23 })
24}
25
26func TestFuncCollection(t *testing.T) {
27 t.Run("Copy", func(t *testing.T) {

Callers

nothing calls this directly

Calls 8

NewOptionsFunction · 0.92
WithFuncsFunction · 0.92
WithUnstableFunction · 0.92
WithoutUnstableFunction · 0.92
RunMethod · 0.45
CopyMethod · 0.45
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected