summaryrefslogtreecommitdiff
path: root/src/pkg/exp/eval/eval_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/exp/eval/eval_test.go')
-rw-r--r--src/pkg/exp/eval/eval_test.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pkg/exp/eval/eval_test.go b/src/pkg/exp/eval/eval_test.go
index 307c50486..354ac0198 100644
--- a/src/pkg/exp/eval/eval_test.go
+++ b/src/pkg/exp/eval/eval_test.go
@@ -45,7 +45,7 @@ func (a test) run(t *testing.T, name string) {
for _, j := range a {
src := j.code;
if noisy {
- println("code:", src);
+ println("code:", src)
}
code, err := w.Compile(src);
@@ -83,7 +83,7 @@ func (a test) run(t *testing.T, name string) {
}
if !j.noval && !reflect.DeepEqual(val, j.val) {
- t.Errorf("%s: Run %s = %T(%v) want %T(%v)", name, src, val, val, j.val, j.val);
+ t.Errorf("%s: Run %s = %T(%v) want %T(%v)", name, src, val, val, j.val, j.val)
}
}
}
@@ -91,7 +91,7 @@ func (a test) run(t *testing.T, name string) {
func match(t *testing.T, err os.Error, pat string) bool {
ok, errstr := testing.MatchString(pat, err.String());
if errstr != "" {
- t.Fatalf("compile regexp %s: %v", pat, errstr);
+ t.Fatalf("compile regexp %s: %v", pat, errstr)
}
return ok;
}
@@ -109,7 +109,7 @@ func RErr(expr string, rterr string) test { return test([]job{job{code: expr, rt
// Expression value
func Val(expr string, val interface{}) test {
- return test([]job{job{code: expr, val: toValue(val)}});
+ return test([]job{job{code: expr, val: toValue(val)}})
}
// Statement runs without error
@@ -119,7 +119,7 @@ func Run(stmts string) test { return test([]job{job{code: stmts, noval: true}})
// TODO(rsc): Should be possible with Run but the parser
// won't let us do both top-level and non-top-level statements.
func Run2(stmt1, stmt2 string) test {
- return test([]job{job{code: stmt1, noval: true}, job{code: stmt2, noval: true}});
+ return test([]job{job{code: stmt1, noval: true}, job{code: stmt2, noval: true}})
}
// Statement runs and test one expression's value
@@ -127,7 +127,7 @@ func Val1(stmts string, expr1 string, val1 interface{}) test {
return test([]job{
job{code: stmts, noval: true},
job{code: expr1, val: toValue(val1)},
- });
+ })
}
// Statement runs and test two expressions' values
@@ -136,7 +136,7 @@ func Val2(stmts string, expr1 string, val1 interface{}, expr2 string, val2 inter
job{code: stmts, noval: true},
job{code: expr1, val: toValue(val1)},
job{code: expr2, val: toValue(val2)},
- });
+ })
}
/*
@@ -167,33 +167,33 @@ func toValue(val interface{}) Value {
r := intV(val);
return &r;
case *bignum.Integer:
- return &idealIntV{val};
+ return &idealIntV{val}
case float:
r := floatV(val);
return &r;
case *bignum.Rational:
- return &idealFloatV{val};
+ return &idealFloatV{val}
case string:
r := stringV(val);
return &r;
case vstruct:
elems := make([]Value, len(val));
for i, e := range val {
- elems[i] = toValue(e);
+ elems[i] = toValue(e)
}
r := structV(elems);
return &r;
case varray:
elems := make([]Value, len(val));
for i, e := range val {
- elems[i] = toValue(e);
+ elems[i] = toValue(e)
}
r := arrayV(elems);
return &r;
case vslice:
- return &sliceV{Slice{toValue(val.arr).(ArrayValue), int64(val.len), int64(val.cap)}};
+ return &sliceV{Slice{toValue(val.arr).(ArrayValue), int64(val.len), int64(val.cap)}}
case Func:
- return &funcV{val};
+ return &funcV{val}
}
log.Crashf("toValue(%T) not implemented", val);
panic();