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)
| 155 | // the instance name, coinbase account, block number, data directory and supported |
| 156 | // console modules. |
| 157 | func 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. |
| 182 | func TestEvaluate(t *testing.T) { |