tests improved

This commit is contained in:
2024-06-26 04:29:40 +02:00
parent 7164e8816c
commit fe5c8e9619
8 changed files with 81 additions and 23 deletions
+3 -4
View File
@@ -21,14 +21,13 @@ func TestFuncFmt(t *testing.T) {
//t.Setenv("EXPR_PATH", ".")
// parserTestSpec(t, section, inputs, 19)
// runTestSuiteSpec(t, section, inputs, 19)
runTestSuite(t, section, inputs)
}
func TestFmt(t *testing.T) {
section := "Builtin-Fmt"
text := "ciao mondo"
inputs := []inputType{
/* 1 */ {fmt.Sprintf(`println("%s")`, text), int64(11), nil},
@@ -43,7 +42,7 @@ func TestFmt(t *testing.T) {
runCtxTestSuite(t, ctx, section, inputs)
SetCtrl(ctx, ControlStdout, currentStdout)
if b.String() != text + "\n" {
if b.String() != text+"\n" {
t.Errorf("println(): Got: %q, Want: %q", b.String(), text+"\n")
}
}