MCPcopy
hub / github.com/bnb-chain/bsc / TestEvaluate

Function TestEvaluate

console/console_test.go:182–190  ·  view source on GitHub ↗

Tests that JavaScript statement evaluation works as intended.

(t *testing.T)

Source from the content-addressed store, hash-verified

180
181// Tests that JavaScript statement evaluation works as intended.
182func 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.
193func TestInteractive(t *testing.T) {

Callers

nothing calls this directly

Calls 6

newTesterFunction · 0.70
CloseMethod · 0.65
StringMethod · 0.65
ContainsMethod · 0.65
EvaluateMethod · 0.45
FatalfMethod · 0.45

Tested by

no test coverage detected