mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
sets equivalence
This commit is contained in:
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])))
|
||||
Reference in New Issue
Block a user