Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
For some reason "result" was interpreted as an array, but "expected" isn't.

See spockframework/spock#880
  • Loading branch information
lptr committed Sep 7, 2018
1 parent f6bcd25 commit 95c0c82
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -87,18 +87,18 @@ class HashCodeTest extends Specification {
"abcdef1234" | "abcdef12" | false
}

def "#a <=> #b: #result"() {
def "#a <=> #b: #expected"() {
def hashA = HashCode.fromString(a)
def hashB = HashCode.fromString(b)
def compareAB = hashA <=> hashB
def compareBA = hashB <=> hashA

expect:
Math.signum(compareAB) == result
Math.signum(compareBA) == -result
Math.signum(compareAB) == expected
Math.signum(compareBA) == -expected

where:
a | b | result
a | b | expected
"abcdef12" | "abcdef12" | 0
"abcdef12" | "abcdef1234" | -1
"abcdef1234" | "abcdef12" | 1
Expand Down

0 comments on commit 95c0c82

Please sign in to comment.