mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
testament :show duration also for failed tests; improve tshould_not_work; mitigate #17946 tchannels timeouts (#17947)
* refs #17946; refactor testament test summary, show test duration for failures; increase timeout tchannels * revert workarounds from https://github.com/nim-lang/Nim/pull/16698 and add allowPrefixMatch optional param to greedyOrderedSubsetLines * add test * workaround for yet another testament bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
timeout: 5.0 # but typically < 1s
|
||||
timeout: 20.0 # but typically < 1s (in isolation but other tests running in parallel can affect this since based on epochTime)
|
||||
disabled: "freebsd"
|
||||
matrix: "--gc:arc --threads:on; --gc:arc --threads:on -d:danger"
|
||||
"""
|
||||
|
||||
@@ -22,3 +22,18 @@ block: # greedyOrderedSubsetLines
|
||||
not greedyOrderedSubsetLines("a1\na5", "a0\na1\na2\na3\na4\na5:suffix")
|
||||
not greedyOrderedSubsetLines("a5", "a0\na1\na2\na3\na4\nprefix:a5")
|
||||
not greedyOrderedSubsetLines("a5", "a0\na1\na2\na3\na4\na5:suffix")
|
||||
|
||||
block: # greedyOrderedSubsetLines with allowPrefixMatch = true
|
||||
template fn(a, b): bool =
|
||||
greedyOrderedSubsetLines(a, b, allowPrefixMatch = true)
|
||||
assertAll:
|
||||
fn("a1\na3", "a0\na1\na2\na3_suffix\na4")
|
||||
not fn("a1\na3", "a0\na1\na2\nprefix_a3\na4")
|
||||
# these are same as above, could be refactored
|
||||
not fn("a3\na1", "a0\na1\na2\na3\na4") # out of order
|
||||
not fn("a1\na5", "a0\na1\na2\na3\na4") # a5 not in lhs
|
||||
|
||||
not fn("a1\na5", "a0\na1\na2\na3\na4\nprefix:a5")
|
||||
fn("a1\na5", "a0\na1\na2\na3\na4\na5:suffix")
|
||||
not fn("a5", "a0\na1\na2\na3\na4\nprefix:a5")
|
||||
fn("a5", "a0\na1\na2\na3\na4\na5:suffix")
|
||||
|
||||
Reference in New Issue
Block a user