MCPcopy Index your code
hub / github.com/google/mangle / TestNameToString

Function TestNameToString

functional/functional_test.go:729–743  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

727}
728
729func TestNameToString(t *testing.T) {
730 name, err := ast.Name("/named/constant")
731 if err != nil {
732 t.Fatal("failed to create name constant: ", err)
733 }
734 term := ast.ApplyFn{symbols.NameToString, []ast.BaseTerm{name}}
735 got, err := EvalExpr(term, ast.ConstSubstMap{})
736 if err != nil {
737 t.Fatal(err)
738 }
739 want := ast.String("/named/constant")
740 if got != want {
741 t.Errorf("EvalExpr(%v)=%v want %v.", term, got, want)
742 }
743}
744
745func TestNameToStringFailure(t *testing.T) {
746 tests := [][]ast.BaseTerm{

Callers

nothing calls this directly

Calls 3

NameFunction · 0.92
StringFunction · 0.92
EvalExprFunction · 0.85

Tested by

no test coverage detected