@@ -26,6 +26,7 @@ import (
26
26
"testing"
27
27
"time"
28
28
29
+ . "github.com/onflow/cadence/test_utils/sema_utils"
29
30
"github.com/rs/zerolog"
30
31
"github.com/stretchr/testify/assert"
31
32
"github.com/stretchr/testify/require"
@@ -35,7 +36,6 @@ import (
35
36
"github.com/onflow/cadence/runtime"
36
37
"github.com/onflow/cadence/sema"
37
38
"github.com/onflow/cadence/stdlib"
38
- "github.com/onflow/cadence/tests/checker"
39
39
)
40
40
41
41
var firstAccountAddress = common.Address {0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 }
@@ -476,7 +476,7 @@ func TestImportContract(t *testing.T) {
476
476
_ , err := runner .RunTest (code , "test" )
477
477
require .Error (t , err )
478
478
479
- errs := checker . RequireCheckerErrors (t , err , 2 )
479
+ errs := RequireCheckerErrors (t , err , 2 )
480
480
481
481
importedProgramError := & sema.ImportedProgramError {}
482
482
assert .ErrorAs (t , errs [0 ], & importedProgramError )
@@ -501,7 +501,7 @@ func TestImportContract(t *testing.T) {
501
501
_ , err := runner .RunTest (code , "test" )
502
502
require .Error (t , err )
503
503
504
- errs := checker . RequireCheckerErrors (t , err , 2 )
504
+ errs := RequireCheckerErrors (t , err , 2 )
505
505
506
506
importedProgramError := & sema.ImportedProgramError {}
507
507
require .ErrorAs (t , errs [0 ], & importedProgramError )
@@ -2608,6 +2608,8 @@ func TestInterpretFailFunction(t *testing.T) {
2608
2608
t .Parallel ()
2609
2609
2610
2610
t .Run ("without message" , func (t * testing.T ) {
2611
+ t .Parallel ()
2612
+
2611
2613
const script = `
2612
2614
import Test
2613
2615
@@ -2624,6 +2626,8 @@ func TestInterpretFailFunction(t *testing.T) {
2624
2626
})
2625
2627
2626
2628
t .Run ("with message" , func (t * testing.T ) {
2629
+ t .Parallel ()
2630
+
2627
2631
const script = `
2628
2632
import Test
2629
2633
@@ -2765,7 +2769,7 @@ func TestInterpretMatcher(t *testing.T) {
2765
2769
runner := NewTestRunner ()
2766
2770
_ , err := runner .RunTest (script , "test" )
2767
2771
require .Error (t , err )
2768
- errs := checker . RequireCheckerErrors (t , err , 1 )
2772
+ errs := RequireCheckerErrors (t , err , 1 )
2769
2773
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
2770
2774
})
2771
2775
@@ -2807,7 +2811,7 @@ func TestInterpretMatcher(t *testing.T) {
2807
2811
_ , err := runner .RunTest (script , "test" )
2808
2812
require .Error (t , err )
2809
2813
2810
- errs := checker . RequireCheckerErrors (t , err , 1 )
2814
+ errs := RequireCheckerErrors (t , err , 1 )
2811
2815
2812
2816
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
2813
2817
})
@@ -2904,7 +2908,7 @@ func TestInterpretEqualMatcher(t *testing.T) {
2904
2908
_ , err := runner .RunTest (script , "test" )
2905
2909
require .Error (t , err )
2906
2910
2907
- errs := checker . RequireCheckerErrors (t , err , 2 )
2911
+ errs := RequireCheckerErrors (t , err , 2 )
2908
2912
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
2909
2913
assert .IsType (t , & sema.TypeMismatchError {}, errs [1 ])
2910
2914
})
@@ -2941,7 +2945,7 @@ func TestInterpretEqualMatcher(t *testing.T) {
2941
2945
_ , err := runner .RunTest (script , "test" )
2942
2946
require .Error (t , err )
2943
2947
2944
- errs := checker . RequireCheckerErrors (t , err , 1 )
2948
+ errs := RequireCheckerErrors (t , err , 1 )
2945
2949
2946
2950
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
2947
2951
})
@@ -3065,7 +3069,7 @@ func TestInterpretEqualMatcher(t *testing.T) {
3065
3069
_ , err := runner .RunTest (script , "test" )
3066
3070
require .Error (t , err )
3067
3071
3068
- errs := checker . RequireCheckerErrors (t , err , 4 )
3072
+ errs := RequireCheckerErrors (t , err , 4 )
3069
3073
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3070
3074
assert .IsType (t , & sema.TypeMismatchError {}, errs [1 ])
3071
3075
assert .IsType (t , & sema.TypeMismatchError {}, errs [2 ])
@@ -3098,7 +3102,7 @@ func TestInterpretEqualMatcher(t *testing.T) {
3098
3102
_ , err := runner .RunTest (script , "test" )
3099
3103
require .Error (t , err )
3100
3104
3101
- errs := checker . RequireCheckerErrors (t , err , 3 )
3105
+ errs := RequireCheckerErrors (t , err , 3 )
3102
3106
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3103
3107
assert .IsType (t , & sema.TypeMismatchError {}, errs [1 ])
3104
3108
assert .IsType (t , & sema.TypeMismatchError {}, errs [2 ])
@@ -3194,7 +3198,7 @@ func TestInterpretExpectFunction(t *testing.T) {
3194
3198
_ , err := runner .RunTest (script , "test" )
3195
3199
require .Error (t , err )
3196
3200
3197
- errs := checker . RequireCheckerErrors (t , err , 1 )
3201
+ errs := RequireCheckerErrors (t , err , 1 )
3198
3202
3199
3203
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3200
3204
})
@@ -3218,7 +3222,7 @@ func TestInterpretExpectFunction(t *testing.T) {
3218
3222
_ , err := runner .RunTest (script , "test" )
3219
3223
require .Error (t , err )
3220
3224
3221
- errs := checker . RequireCheckerErrors (t , err , 2 )
3225
+ errs := RequireCheckerErrors (t , err , 2 )
3222
3226
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3223
3227
assert .IsType (t , & sema.TypeMismatchError {}, errs [1 ])
3224
3228
})
@@ -3243,7 +3247,7 @@ func TestInterpretExpectFunction(t *testing.T) {
3243
3247
_ , err := runner .RunTest (script , "test" )
3244
3248
require .Error (t , err )
3245
3249
3246
- errs := checker . RequireCheckerErrors (t , err , 1 )
3250
+ errs := RequireCheckerErrors (t , err , 1 )
3247
3251
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3248
3252
})
3249
3253
@@ -3267,7 +3271,7 @@ func TestInterpretExpectFunction(t *testing.T) {
3267
3271
_ , err := runner .RunTest (script , "test" )
3268
3272
require .Error (t , err )
3269
3273
3270
- errs := checker . RequireCheckerErrors (t , err , 1 )
3274
+ errs := RequireCheckerErrors (t , err , 1 )
3271
3275
assert .IsType (t , & sema.TypeMismatchError {}, errs [0 ])
3272
3276
})
3273
3277
}
0 commit comments