Skip to content

Commit cc120f8

Browse files
committed
Add reasoning for skipping the comparison
1 parent 3f39ca7 commit cc120f8

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

interpreter/builtinfunctions_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ func TestInterpretNativeFunctionWithMultipleTypeParameters(t *testing.T) {
11531153
baseActivation := activations.NewActivation(nil, interpreter.BaseActivation)
11541154
interpreter.Declare(baseActivation, valueDeclaration)
11551155

1156+
// The native function is only for the VM when `compile` flag is on.
1157+
// Running the interpreter with that is not possible.
11561158
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(t,
11571159
`
11581160
fun test() {

interpreter/member_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func TestInterpretMemberAccessType(t *testing.T) {
4444

4545
t.Parallel()
4646

47+
// The passed in argument is created with VM.
48+
// Therefore, the updates are only visible to VM.
49+
// So comparing the storage is not possible.
4750
inter := parseCheckAndPrepareWithoutStorageComparison(t, `
4851
struct S {
4952
var foo: Int
@@ -208,6 +211,9 @@ func TestInterpretMemberAccessType(t *testing.T) {
208211

209212
t.Parallel()
210213

214+
// The passed in argument is created with VM.
215+
// Therefore, the updates are only visible to VM.
216+
// So comparing the storage is not possible.
211217
inter := parseCheckAndPrepareWithoutStorageComparison(t, `
212218
struct interface SI {
213219
var foo: Int
@@ -388,6 +394,9 @@ func TestInterpretMemberAccessType(t *testing.T) {
388394

389395
t.Parallel()
390396

397+
// The passed in argument is created with VM.
398+
// Therefore, the updates are only visible to VM.
399+
// So comparing the storage is not possible.
391400
inter := parseCheckAndPrepareWithoutStorageComparison(t, `
392401
struct S {
393402
var foo: Int

interpreter/misc_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4989,6 +4989,10 @@ func TestInterpretReferenceFailableDowncasting(t *testing.T) {
49894989
interpreter.Declare(baseActivation, valueDeclaration)
49904990

49914991
var err error
4992+
4993+
// This test manipulates the storage externally.
4994+
// But it only does that to the VM's storage.
4995+
// So comparing the storage is not possible.
49924996
inter, err = parseCheckAndPrepareWithOptionsWithoutStorageComparison(t,
49934997
`
49944998
resource interface RI {}
@@ -12736,6 +12740,9 @@ func TestInterpretSomeValueChildContainerMutation(t *testing.T) {
1273612740

1273712741
newInter := func() Invokable {
1273812742

12743+
// This test manipulates the storage externally.
12744+
// But it only does that to the VM's storage.
12745+
// So comparing the storage is not possible.
1273912746
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(t,
1274012747
code,
1274112748
ParseCheckAndInterpretOptions{
@@ -13450,6 +13457,8 @@ func TestInterpretVariableDeclarationSecondValueEvaluationOrder(t *testing.T) {
1345013457
baseActivation := activations.NewActivation(nil, interpreter.BaseActivation)
1345113458
interpreter.Declare(baseActivation, getKeyFunction)
1345213459

13460+
// Uses a standard library with a closure.
13461+
// Using it in the interpreter make it count twice.
1345313462
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(
1345413463
t,
1345513464
fmt.Sprintf(`
@@ -13539,6 +13548,8 @@ func TestInterpretVariableDeclarationSecondValueEvaluationOrder(t *testing.T) {
1353913548
interpreter.Declare(baseActivation, getKey1Function)
1354013549
interpreter.Declare(baseActivation, getKey2Function)
1354113550

13551+
// Uses a standard library with a closure.
13552+
// Using it in the interpreter make it count twice.
1354213553
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(
1354313554
t,
1354413555
`
@@ -13615,6 +13626,8 @@ func TestInterpretVariableDeclarationSecondValueEvaluationOrder(t *testing.T) {
1361513626
baseActivation := activations.NewActivation(nil, interpreter.BaseActivation)
1361613627
interpreter.Declare(baseActivation, getKeyFunction)
1361713628

13629+
// Uses a standard library with a closure.
13630+
// Using it in the interpreter make it count twice.
1361813631
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(
1361913632
t,
1362013633
`
@@ -13703,6 +13716,8 @@ func TestInterpretVariableDeclarationSecondValueEvaluationOrder(t *testing.T) {
1370313716
interpreter.Declare(baseActivation, getKey1Function)
1370413717
interpreter.Declare(baseActivation, getKey2Function)
1370513718

13719+
// Uses a standard library with a closure.
13720+
// Using it in the interpreter make it count twice.
1370613721
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(
1370713722
t,
1370813723
`
@@ -13781,6 +13796,8 @@ func TestInterpretVariableDeclarationSecondValueEvaluationOrder(t *testing.T) {
1378113796
baseActivation := activations.NewActivation(nil, interpreter.BaseActivation)
1378213797
interpreter.Declare(baseActivation, getKeyFunction)
1378313798

13799+
// Uses a standard library with a closure.
13800+
// Using it in the interpreter make it count twice.
1378413801
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(
1378513802
t,
1378613803
`

interpreter/reference_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,9 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
910910

911911
t.Parallel()
912912

913+
// The passed in argument is created with VM.
914+
// Therefore, the value's slabs are only visible to VM's storage.
915+
// So comparing the storage is not possible.
913916
inter, err := parseCheckAndPrepareWithOptionsWithoutStorageComparison(t, `
914917
resource R {
915918
access(all) var id: Int
@@ -2861,7 +2864,6 @@ func TestInterpretDereference(t *testing.T) {
28612864
})
28622865

28632866
t.Run("{Int: [String]}", func(t *testing.T) {
2864-
t.SkipNow()
28652867

28662868
inter := parseCheckAndPrepare(
28672869
t,

0 commit comments

Comments
 (0)