@@ -2318,23 +2318,16 @@ func TestEval_slices_out_of_bound(t *testing.T) {
23182318 }
23192319}
23202320
2321- func TestExpr_custom_tests (t * testing.T ) {
2322- f , err := os . Open ( "custom_tests.json" )
2323- if os . IsNotExist ( err ) {
2324- t . Skip ( "no custom tests" )
2325- return
2321+ func TestExpr_timeout (t * testing.T ) {
2322+ tests := [] struct { code string }{
2323+ { `-999999..999999` },
2324+ { `map(1..999999, 1..999999)` },
2325+ { `map(1..999999, repeat('a', #))` },
23262326 }
23272327
2328- require .NoError (t , err , "open file error" )
2329- defer f .Close ()
2330-
2331- var tests []string
2332- err = json .NewDecoder (f ).Decode (& tests )
2333- require .NoError (t , err , "decode json error" )
2334-
2335- for id , tt := range tests {
2336- t .Run (fmt .Sprintf ("line %v" , id + 2 ), func (t * testing.T ) {
2337- program , err := expr .Compile (tt )
2328+ for _ , tt := range tests {
2329+ t .Run (tt .code , func (t * testing.T ) {
2330+ program , err := expr .Compile (tt .code )
23382331 require .NoError (t , err )
23392332
23402333 timeout := make (chan bool , 1 )
0 commit comments