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

Function TestRoundtrip

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

Source from the content-addressed store, hash-verified

993}
994
995func TestRoundtrip(t *testing.T) {
996 tests := []ast.Constant{
997 ast.String("foo"),
998 ast.String(`fo"\o`),
999 ast.String(`"`),
1000 }
1001 for _, c := range tests {
1002 parsed, err := BaseTerm(c.String())
1003 if err != nil {
1004 t.Fatalf("BaseTerm(%v) failed with %v", c, err)
1005 }
1006 if !c.Equals(parsed) {
1007 t.Errorf("BaseTerm(%v) = %v want %v", c, parsed, c)
1008 }
1009 }
1010}
1011
1012func TestPredicateNamePositive(t *testing.T) {
1013 tests := []struct {

Callers

nothing calls this directly

Calls 4

StringFunction · 0.92
BaseTermFunction · 0.70
StringMethod · 0.65
EqualsMethod · 0.65

Tested by

no test coverage detected