Tests that JavaScript statement evaluation works as intended.
(t *testing.T)
| 180 | |
| 181 | // Tests that JavaScript statement evaluation works as intended. |
| 182 | func TestEvaluate(t *testing.T) { |
| 183 | tester := newTester(t, nil) |
| 184 | defer tester.Close(t) |
| 185 | |
| 186 | tester.console.Evaluate("2 + 2") |
| 187 | if output := tester.output.String(); !strings.Contains(output, "4") { |
| 188 | t.Fatalf("statement evaluation failed: have %s, want %s", output, "4") |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // Tests that the console can be used in interactive mode. |
| 193 | func TestInteractive(t *testing.T) { |