@@ -164,7 +164,7 @@ func TestWelcome(t *testing.T) {
164164
165165 tester .console .Welcome ()
166166
167- output := string ( tester .output .Bytes () )
167+ output := tester .output .String ( )
168168 if want := "Welcome" ; ! strings .Contains (output , want ) {
169169 t .Fatalf ("console output missing welcome message: have\n %s\n want also %s" , output , want )
170170 }
@@ -188,7 +188,7 @@ func TestEvaluate(t *testing.T) {
188188 defer tester .Close (t )
189189
190190 tester .console .Evaluate ("2 + 2" )
191- if output := string ( tester .output .Bytes () ); ! strings .Contains (output , "4" ) {
191+ if output := tester .output .String ( ); ! strings .Contains (output , "4" ) {
192192 t .Fatalf ("statement evaluation failed: have %s, want %s" , output , "4" )
193193 }
194194}
@@ -218,7 +218,7 @@ func TestInteractive(t *testing.T) {
218218 case <- time .After (time .Second ):
219219 t .Fatalf ("secondary prompt timeout" )
220220 }
221- if output := string ( tester .output .Bytes () ); ! strings .Contains (output , "4" ) {
221+ if output := tester .output .String ( ); ! strings .Contains (output , "4" ) {
222222 t .Fatalf ("statement evaluation failed: have %s, want %s" , output , "4" )
223223 }
224224}
@@ -230,7 +230,7 @@ func TestPreload(t *testing.T) {
230230 defer tester .Close (t )
231231
232232 tester .console .Evaluate ("preloaded" )
233- if output := string ( tester .output .Bytes () ); ! strings .Contains (output , "some-preloaded-string" ) {
233+ if output := tester .output .String ( ); ! strings .Contains (output , "some-preloaded-string" ) {
234234 t .Fatalf ("preloaded variable missing: have %s, want %s" , output , "some-preloaded-string" )
235235 }
236236}
@@ -243,7 +243,7 @@ func TestExecute(t *testing.T) {
243243 tester .console .Execute ("exec.js" )
244244
245245 tester .console .Evaluate ("execed" )
246- if output := string ( tester .output .Bytes () ); ! strings .Contains (output , "some-executed-string" ) {
246+ if output := tester .output .String ( ); ! strings .Contains (output , "some-executed-string" ) {
247247 t .Fatalf ("execed variable missing: have %s, want %s" , output , "some-executed-string" )
248248 }
249249}
@@ -275,7 +275,7 @@ func TestPrettyPrint(t *testing.T) {
275275 string: ` + two + `
276276}
277277`
278- if output := string ( tester .output .Bytes () ); output != want {
278+ if output := tester .output .String ( ); output != want {
279279 t .Fatalf ("pretty print mismatch: have %s, want %s" , output , want )
280280 }
281281}
@@ -287,7 +287,7 @@ func TestPrettyError(t *testing.T) {
287287 tester .console .Evaluate ("throw 'hello'" )
288288
289289 want := jsre .ErrorColor ("hello" ) + "\n "
290- if output := string ( tester .output .Bytes () ); output != want {
290+ if output := tester .output .String ( ); output != want {
291291 t .Fatalf ("pretty error mismatch: have %s, want %s" , output , want )
292292 }
293293}
0 commit comments