@@ -11,6 +11,7 @@ import au.com.dius.pact.core.model.matchingrules.RegexMatcher
11
11
import au.com.dius.pact.core.model.matchingrules.TimeMatcher
12
12
import au.com.dius.pact.core.model.matchingrules.TimestampMatcher
13
13
import au.com.dius.pact.core.model.matchingrules.TypeMatcher
14
+ import com.google.gson.JsonNull
14
15
import spock.lang.Specification
15
16
import spock.lang.Unroll
16
17
@@ -35,13 +36,16 @@ class MatcherExecutorSpec extends Specification {
35
36
MatcherExecutorKt . domatch(EqualsMatcher . INSTANCE , path, expected, actual, mismatchFactory). empty == mustBeEmpty
36
37
37
38
where :
38
- expected | actual || mustBeEmpty
39
- ' 100' | ' 100' || true
40
- 100 | ' 100' || false
41
- 100 | 100 || true
42
- null | null || true
43
- ' 100' | null || false
44
- null | 100 || false
39
+ expected | actual || mustBeEmpty
40
+ ' 100' | ' 100' || true
41
+ 100 | ' 100' || false
42
+ 100 | 100 || true
43
+ null | null || true
44
+ ' 100' | null || false
45
+ null | 100 || false
46
+ JsonNull . INSTANCE | null || true
47
+ null | JsonNull . INSTANCE || true
48
+ JsonNull . INSTANCE | JsonNull . INSTANCE || true
45
49
}
46
50
47
51
@Unroll
@@ -62,15 +66,18 @@ class MatcherExecutorSpec extends Specification {
62
66
MatcherExecutorKt . domatch(TypeMatcher . INSTANCE , path, expected, actual, mismatchFactory). empty == mustBeEmpty
63
67
64
68
where :
65
- expected | actual || mustBeEmpty
66
- ' Harry' | ' Some other string' || true
67
- 100 | 200.3 || true
68
- true | false || true
69
- null | null || true
70
- ' 200' | 200 || false
71
- 200 | null || false
72
- [100 , 200 , 300 ] | [200.3 ] || true
73
- [a : 100 ] | [a : 200.3 , b : 200 , c : 300 ] || true
69
+ expected | actual || mustBeEmpty
70
+ ' Harry' | ' Some other string' || true
71
+ 100 | 200.3 || true
72
+ true | false || true
73
+ null | null || true
74
+ ' 200' | 200 || false
75
+ 200 | null || false
76
+ [100 , 200 , 300 ] | [200.3 ] || true
77
+ [a : 100 ] | [a : 200.3 , b : 200 , c : 300 ] || true
78
+ JsonNull . INSTANCE | null || true
79
+ null | JsonNull . INSTANCE || true
80
+ JsonNull . INSTANCE | JsonNull . INSTANCE || true
74
81
}
75
82
76
83
@Unroll
0 commit comments