Esempio n. 1
0
func TestBasicEscaped(t *testing.T) {
	result := example.TMPLbasic("<aaa&...", 10)
	expected := `String:&lt;aaa&amp;...
Unescaped:<aaa&...
Num:10
This {{ is ignored
So is this }} !`
	if explanation, ok := linesEquals(strings.TrimSpace(expected), strings.TrimSpace(result)); !ok {
		t.Error(explanation)
	}
}
Esempio n. 2
0
func TestBasic(t *testing.T) {
	result := example.TMPLbasic("aaa", 10)
	expected := `String:aaa
Unescaped:aaa
Num:10
This {{ is ignored
So is this }} !`
	if strings.TrimSpace(expected) != strings.TrimSpace(result) {
		t.Error("Expected:", expected, "was:", result)
	}
}