mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 13:04:44 +00:00
corrected docs and tests
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
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])))
|
||||
doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3,4]), "equivalent or subset")
|
||||
doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3]), "equivalent or subset")
|
||||
doAssert((not(toSet(@[1,2,3]) <= toSet(@[1,2]))), "equivalent or subset")
|
||||
doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3,4]), "strict subset")
|
||||
doAssert((not(toSet(@[1,2,3]) < toSet(@[1,2,3]))), "strict subset")
|
||||
doAssert((not(toSet(@[1,2,3]) < toSet(@[1,2]))), "strict subset")
|
||||
doAssert((not(toSet(@[1,2,3]) == toSet(@[1,2,3,4]))), "==")
|
||||
doAssert(toSet(@[1,2,3]) == toSet(@[1,2,3]), "==")
|
||||
doAssert((not(toSet(@[1,2,3]) == toSet(@[1,2]))), "==")
|
||||
|
||||
Reference in New Issue
Block a user