sets equivalence
This commit is contained in:
parent
e01fb17d02
commit
2c5a2d07fb
2 changed files with 33 additions and 0 deletions
16
tests/sets/testequivalence.nim
Normal file
16
tests/sets/testequivalence.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import unittest
|
||||
import sets
|
||||
|
||||
suite "sets":
|
||||
test "equivalent or subset":
|
||||
check toSet(@[1,2,3]) <= toSet(@[1,2,3,4])
|
||||
check toSet(@[1,2,3]) <= toSet(@[1,2,3])
|
||||
check(not(toSet(@[1,2,3]) <= toSet(@[1,2])))
|
||||
test "strict subset":
|
||||
check toSet(@[1,2,3]) <= toSet(@[1,2,3,4])
|
||||
check(not(toSet(@[1,2,3]) < toSet(@[1,2,3])))
|
||||
check(not(toSet(@[1,2,3]) < toSet(@[1,2])))
|
||||
test "==":
|
||||
check(not(toSet(@[1,2,3]) == toSet(@[1,2,3,4])))
|
||||
check toSet(@[1,2,3]) == toSet(@[1,2,3])
|
||||
check(not(toSet(@[1,2,3]) == toSet(@[1,2])))
|
||||
Loading…
Add table
Add a link
Reference in a new issue