diff --git a/lang/interpret_test.go b/lang/interpret_test.go index 97af3509..6db8a394 100644 --- a/lang/interpret_test.go +++ b/lang/interpret_test.go @@ -548,7 +548,7 @@ func TestAstFunc1(t *testing.T) { const magicError = "# err: " const magicErrorLexParse = "errLexParse: " const magicErrorFailInit = "errInit: " - const magicError2 = "err2: " + const magicErrorSetScope = "errSetScope: " const magicError3 = "err3: " const magicError4 = "err4: " const magicEmpty = "# empty!" @@ -581,7 +581,7 @@ func TestAstFunc1(t *testing.T) { type errs struct { failLexParse bool failInit bool - fail2 bool + failSetScope bool fail3 bool fail4 bool } @@ -638,7 +638,7 @@ func TestAstFunc1(t *testing.T) { errStr := "" failLexParse := false failInit := false - fail2 := false + failSetScope := false fail3 := false fail4 := false if strings.HasPrefix(str, magicError) { @@ -655,10 +655,10 @@ func TestAstFunc1(t *testing.T) { str = errStr failInit = true } - if strings.HasPrefix(str, magicError2) { - errStr = strings.TrimPrefix(str, magicError2) + if strings.HasPrefix(str, magicErrorSetScope) { + errStr = strings.TrimPrefix(str, magicErrorSetScope) str = errStr - fail2 = true + failSetScope = true } if strings.HasPrefix(str, magicError3) { errStr = strings.TrimPrefix(str, magicError3) @@ -681,7 +681,7 @@ func TestAstFunc1(t *testing.T) { errs: errs{ failLexParse: failLexParse, failInit: failInit, - fail2: fail2, + failSetScope: failSetScope, fail3: fail3, fail4: fail4, }, @@ -719,7 +719,7 @@ func TestAstFunc1(t *testing.T) { src := dir + path // location of the test failLexParse := errs.failLexParse failInit := errs.failInit - fail2 := errs.fail2 + failSetScope := errs.failSetScope fail3 := errs.fail3 fail4 := errs.fail4 @@ -859,12 +859,12 @@ func TestAstFunc1(t *testing.T) { // propagate the scope down through the AST... err = iast.SetScope(scope) - if (!fail || !fail2) && err != nil { + if (!fail || !failSetScope) && err != nil { t.Errorf("test #%d: FAIL", index) t.Errorf("test #%d: could not set scope: %+v", index, err) return } - if fail2 && err != nil { + if failSetScope && err != nil { s := err.Error() // convert to string if s != expstr { t.Errorf("test #%d: FAIL", index) @@ -874,7 +874,7 @@ func TestAstFunc1(t *testing.T) { } return // fail happened during set scope, don't run unification! } - if fail2 && err == nil { + if failSetScope && err == nil { t.Errorf("test #%d: FAIL", index) t.Errorf("test #%d: set scope passed, expected fail", index) return @@ -1002,7 +1002,7 @@ func TestAstFunc2(t *testing.T) { const magicError9 = "err9: " // TODO: rename const magicError8 = "err8: " // TODO: rename // TODO: move them all down by one - const magicError2 = "err2: " + const magicErrorSetScope = "errSetScope: " const magicError3 = "err3: " const magicError4 = "err4: " const magicError5 = "err5: " @@ -1039,11 +1039,11 @@ func TestAstFunc2(t *testing.T) { fail9 bool // TODO: rename fail8 bool // TODO: rename // TODO: move them all down by one - fail2 bool - fail3 bool - fail4 bool - fail5 bool - fail6 bool + failSetScope bool + fail3 bool + fail4 bool + fail5 bool + fail6 bool } type test struct { // an individual test name string @@ -1100,7 +1100,7 @@ func TestAstFunc2(t *testing.T) { fail9 := false // TODO: rename fail8 := false // TODO: rename // TODO: move them all down by one - fail2 := false + failSetScope := false fail3 := false fail4 := false fail5 := false @@ -1125,10 +1125,10 @@ func TestAstFunc2(t *testing.T) { fail8 = true } // TODO: move them all down by one - if strings.HasPrefix(str, magicError2) { - errStr = strings.TrimPrefix(str, magicError2) + if strings.HasPrefix(str, magicErrorSetScope) { + errStr = strings.TrimPrefix(str, magicErrorSetScope) str = errStr - fail2 = true + failSetScope = true } if strings.HasPrefix(str, magicError3) { errStr = strings.TrimPrefix(str, magicError3) @@ -1163,11 +1163,11 @@ func TestAstFunc2(t *testing.T) { fail9: fail9, // TODO: rename fail8: fail8, // TODO: rename // TODO: move them all down by one - fail2: fail2, - fail3: fail3, - fail4: fail4, - fail5: fail5, - fail6: fail6, + failSetScope: failSetScope, + fail3: fail3, + fail4: fail4, + fail5: fail5, + fail6: fail6, }, }) //t.Logf("adding: %s", f + "/") @@ -1205,7 +1205,7 @@ func TestAstFunc2(t *testing.T) { fail9 := errs.fail9 // TODO: rename fail8 := errs.fail8 // TODO: rename // TODO: move them all down by one - fail2 := errs.fail2 + failSetScope := errs.failSetScope fail3 := errs.fail3 fail4 := errs.fail4 fail5 := errs.fail5 @@ -1376,12 +1376,12 @@ func TestAstFunc2(t *testing.T) { // propagate the scope down through the AST... err = iast.SetScope(scope) - if (!fail || !fail2) && err != nil { + if (!fail || !failSetScope) && err != nil { t.Errorf("test #%d: FAIL", index) t.Errorf("test #%d: could not set scope: %+v", index, err) return } - if fail2 && err != nil { + if failSetScope && err != nil { s := err.Error() // convert to string if s != expstr { t.Errorf("test #%d: FAIL", index) @@ -1391,7 +1391,7 @@ func TestAstFunc2(t *testing.T) { } return // fail happened during set scope, don't run unification! } - if fail2 && err == nil { + if failSetScope && err == nil { t.Errorf("test #%d: FAIL", index) t.Errorf("test #%d: set scope passed, expected fail", index) return diff --git a/lang/interpret_test/TestAstFunc1/importscope1.graph b/lang/interpret_test/TestAstFunc1/importscope1.graph index 7c78bca0..d64103f1 100644 --- a/lang/interpret_test/TestAstFunc1/importscope1.graph +++ b/lang/interpret_test/TestAstFunc1/importscope1.graph @@ -1 +1 @@ -# err: err2: import scope `second.mcl` failed: local import of `second.mcl` failed: could not set scope from import: func `os.is_debian` does not exist in this scope +# err: errSetScope: import scope `second.mcl` failed: local import of `second.mcl` failed: could not set scope from import: func `os.is_debian` does not exist in this scope diff --git a/lang/interpret_test/TestAstFunc1/recursive_class1.graph b/lang/interpret_test/TestAstFunc1/recursive_class1.graph index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc1/recursive_class1.graph +++ b/lang/interpret_test/TestAstFunc1/recursive_class1.graph @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc1/recursive_class2.graph b/lang/interpret_test/TestAstFunc1/recursive_class2.graph index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc1/recursive_class2.graph +++ b/lang/interpret_test/TestAstFunc1/recursive_class2.graph @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc1/unused1.graph b/lang/interpret_test/TestAstFunc1/unused1.graph index 5f5fa7b3..bc52c40b 100644 --- a/lang/interpret_test/TestAstFunc1/unused1.graph +++ b/lang/interpret_test/TestAstFunc1/unused1.graph @@ -1 +1 @@ -# err: err2: import scope `something.mcl` failed: local import of `something.mcl` failed: module contains unused statements: found stmt: res(print) +# err: errSetScope: import scope `something.mcl` failed: local import of `something.mcl` failed: module contains unused statements: found stmt: res(print) diff --git a/lang/interpret_test/TestAstFunc2/class-capture7.output b/lang/interpret_test/TestAstFunc2/class-capture7.output index 81fe2e67..b82da651 100644 --- a/lang/interpret_test/TestAstFunc2/class-capture7.output +++ b/lang/interpret_test/TestAstFunc2/class-capture7.output @@ -1 +1 @@ -# err: err2: class `bar` does not exist in this scope +# err: errSetScope: class `bar` does not exist in this scope diff --git a/lang/interpret_test/TestAstFunc2/class-recursion1.output b/lang/interpret_test/TestAstFunc2/class-recursion1.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/class-recursion1.output +++ b/lang/interpret_test/TestAstFunc2/class-recursion1.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/class-recursion2.output b/lang/interpret_test/TestAstFunc2/class-recursion2.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/class-recursion2.output +++ b/lang/interpret_test/TestAstFunc2/class-recursion2.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/func-gen1.output b/lang/interpret_test/TestAstFunc2/func-gen1.output index a42e4b62..7f5b009f 100644 --- a/lang/interpret_test/TestAstFunc2/func-gen1.output +++ b/lang/interpret_test/TestAstFunc2/func-gen1.output @@ -1 +1 @@ -# err: err2: func `fun1` does not exist in this scope +# err: errSetScope: func `fun1` does not exist in this scope diff --git a/lang/interpret_test/TestAstFunc2/func-gen2.output b/lang/interpret_test/TestAstFunc2/func-gen2.output index 13ec753f..2e3faa32 100644 --- a/lang/interpret_test/TestAstFunc2/func-gen2.output +++ b/lang/interpret_test/TestAstFunc2/func-gen2.output @@ -1 +1 @@ -# err: err2: func `fun2` does not exist in this scope +# err: errSetScope: func `fun2` does not exist in this scope diff --git a/lang/interpret_test/TestAstFunc2/lambdafunc-recursive-double.output b/lang/interpret_test/TestAstFunc2/lambdafunc-recursive-double.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/lambdafunc-recursive-double.output +++ b/lang/interpret_test/TestAstFunc2/lambdafunc-recursive-double.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/lambdafunc-recursive.output b/lang/interpret_test/TestAstFunc2/lambdafunc-recursive.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/lambdafunc-recursive.output +++ b/lang/interpret_test/TestAstFunc2/lambdafunc-recursive.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/stack-overflow.output b/lang/interpret_test/TestAstFunc2/stack-overflow.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/stack-overflow.output +++ b/lang/interpret_test/TestAstFunc2/stack-overflow.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-double.output b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-double.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-double.output +++ b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-double.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.output b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.output +++ b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag diff --git a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive.output b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive.output index 59136c07..879ea314 100644 --- a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive.output +++ b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive.output @@ -1 +1 @@ -# err: err2: recursive reference while setting scope: not a dag +# err: errSetScope: recursive reference while setting scope: not a dag