88 "path/filepath"
99 "testing"
1010
11- "github.com/Dobefu/DLiteScript/internal/datavalue"
1211 "github.com/Dobefu/DLiteScript/internal/errorutil"
1312)
1413
@@ -70,19 +69,13 @@ func TestMainRun(t *testing.T) {
7069 t .Errorf ("expected no error, got '%s'" , err .Error ())
7170 },
7271
73- result : datavalue . Null () ,
72+ result : "" ,
7473 }
7574
7675 main .Run ()
7776
78- result , err := main .result .AsNumber ()
79-
80- if err != nil {
81- t .Fatalf ("expected numeric result, got type error: %v" , err )
82- }
83-
84- if result != test .expected {
85- t .Errorf ("expected '%f', got '%f'" , test .expected , result )
77+ if main .result != "" {
78+ t .Errorf ("expected empty output, got '%s'" , main .result )
8679 }
8780 }
8881}
@@ -135,7 +128,7 @@ func TestMainErr(t *testing.T) {
135128 }
136129 },
137130
138- result : datavalue . Null () ,
131+ result : "" ,
139132 }
140133
141134 main .Run ()
@@ -174,7 +167,7 @@ func TestMainWriteError(t *testing.T) {
174167 mainErr = err
175168 }
176169 },
177- result : datavalue . Null () ,
170+ result : "" ,
178171 }
179172
180173 main .Run ()
@@ -194,7 +187,7 @@ func BenchmarkMain(b *testing.B) {
194187 onError : func (err error ) {
195188 b .Errorf ("expected no error, got '%s'" , err .Error ())
196189 },
197- result : datavalue . Null () ,
190+ result : "" ,
198191 }
199192
200193 main .Run ()
0 commit comments