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

Function TestStringConcatenateForNameConstant

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

Source from the content-addressed store, hash-verified

812}
813
814func TestStringConcatenateForNameConstant(t *testing.T) {
815 name, err := ast.Name("/named/constant")
816 if err != nil {
817 t.Fatal("failed to create name constant: ", err)
818 }
819
820 term := ast.ApplyFn{symbols.StringConcatenate, []ast.BaseTerm{name}}
821 got, err := EvalExpr(term, ast.ConstSubstMap{})
822 if err != nil {
823 t.Fatal(err)
824 }
825 want := ast.String("/named/constant")
826 if got != want {
827 t.Errorf("EvalExpr(%v)=%v want %v.", term, got, want)
828 }
829}
830
831func TestStringConcatenateFailure(t *testing.T) {
832 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