MCPcopy
hub / github.com/google/mangle / TestParseNotAtom

Function TestParseNotAtom

parse/parse_test.go:1108–1129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1106}
1107
1108func TestParseNotAtom(t *testing.T) {
1109 tests := []struct {
1110 name string
1111 str string
1112 }{
1113 {name: "constant", str: "/foo"},
1114 {name: "number", str: "42"},
1115 {name: "variable", str: "X"},
1116 {name: "list", str: "[1, 2]"},
1117 {name: "empty list", str: "[]"},
1118 {name: "map", str: "[/a : /b]"},
1119 {name: "struct", str: "{ /a : /b }"},
1120 {name: "fn application (not predicate atom)", str: "fn:list(1, 2)"},
1121 }
1122 for _, tt := range tests {
1123 t.Run(tt.name, func(t *testing.T) {
1124 if got, err := Atom(tt.str); err == nil {
1125 t.Errorf("Atom(%q) = %v; want error", tt.str, got)
1126 }
1127 })
1128 }
1129}

Callers

nothing calls this directly

Calls 1

AtomFunction · 0.70

Tested by

no test coverage detected