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

Function TestWelcome

console/console_test.go:157–179  ·  view source on GitHub ↗

Tests that the node lists the correct welcome message, notably that it contains the instance name, coinbase account, block number, data directory and supported console modules.

(t *testing.T)

Source from the content-addressed store, hash-verified

155// the instance name, coinbase account, block number, data directory and supported
156// console modules.
157func TestWelcome(t *testing.T) {
158 tester := newTester(t, nil)
159 defer tester.Close(t)
160
161 tester.console.Welcome()
162
163 output := tester.output.String()
164 if want := "Welcome"; !strings.Contains(output, want) {
165 t.Fatalf("console output missing welcome message: have\n%s\nwant also %s", output, want)
166 }
167 if want := fmt.Sprintf("instance: %s", testInstance); !strings.Contains(output, want) {
168 t.Fatalf("console output missing instance: have\n%s\nwant also %s", output, want)
169 }
170 if want := fmt.Sprintf("coinbase: %s", testAddress); !strings.Contains(output, want) {
171 t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want)
172 }
173 if want := "at block: 0"; !strings.Contains(output, want) {
174 t.Fatalf("console output missing sync status: have\n%s\nwant also %s", output, want)
175 }
176 if want := fmt.Sprintf("datadir: %s", tester.workspace); !strings.Contains(output, want) {
177 t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want)
178 }
179}
180
181// Tests that JavaScript statement evaluation works as intended.
182func TestEvaluate(t *testing.T) {

Callers

nothing calls this directly

Calls 6

WelcomeMethod · 0.80
newTesterFunction · 0.70
CloseMethod · 0.65
StringMethod · 0.65
ContainsMethod · 0.65
FatalfMethod · 0.45

Tested by

no test coverage detected