-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from com-lihaoyi/topic/merge
Support concatenation and grouping of `Tests` instances
- Loading branch information
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package test.utest | ||
|
||
import utest.framework.Tree | ||
import utest._ | ||
|
||
abstract class MergeSubTests1 extends TestSuite { | ||
var run = Vector.empty[Int] | ||
override def tests = Tests { | ||
"one" - { run :+= 1 } | ||
test("two") { run :+= 2 } | ||
"three" - { run :+= 3 } | ||
} | ||
} | ||
|
||
abstract class MergeSubTests2 extends TestSuite { | ||
var run = Vector.empty[Int] | ||
override def tests = Tests { | ||
"one" - { run :+= 1 } | ||
test("two") { run :+= 2 } | ||
} | ||
} | ||
|
||
object MergeTestsTest extends TestSuite { | ||
|
||
val x = new MergeSubTests1 {} | ||
val y = new MergeSubTests2 {} | ||
|
||
val local = Tests { | ||
"makeSureTestsRan" - { | ||
test("x") { assert(x.run == Vector(1, 2, 3) ) } | ||
test("y") { assert(y.run == Vector(1, 2) ) } | ||
} | ||
} | ||
|
||
override def tests = | ||
x.tests.prefix("fst") ++ | ||
y.tests.prefix("snd") ++ | ||
local | ||
|
||
override def utestAfterAll(): Unit = { | ||
assert(x.run == Vector(1, 2, 3)) | ||
assert(y.run == Vector(1, 2)) | ||
} | ||
} |