@@ -36,13 +36,60 @@ object LineNumbersTests extends utest.TestSuite {
36
36
test(" test7" ) {
37
37
val result = " testing" .trim()
38
38
assert(result == " notMatching" )
39
- test(" innerTest5" ) {
39
+ test(" innerTest55" ) {
40
+ assert(1 == 1 )
41
+ }
42
+ result
43
+ }
44
+ test(" test8" ) {
45
+ val result = " testing" .trim()
46
+ val blockWithFailingAssert = {
47
+ assert(" matching" == " notMatching" )
48
+ assert(1 == 2 )
49
+ }
50
+ test(" innerTest55" ) {
51
+ assert(1 == 1 )
52
+ }
53
+ result
54
+ }
55
+ test(" test9" ) {
56
+ val result = " testing" .trim()
57
+ val methodWithFailingAssert = println(
58
+ assert(1 == 2 )
59
+ )
60
+ test(" innerTest55" ) {
40
61
assert(1 == 1 )
41
62
}
42
63
result
43
64
}
65
+ test(" test10" ) - Obj (1 ).method{ x =>
66
+ assert(x.elem == " notMatching" )
67
+ }
68
+ test(" test11" ){
69
+ def xx (body : Int )(rest: Int ) = body == rest
70
+ val partiallyApplied = xx{
71
+ assert(1 == 2 )
72
+ 1
73
+ }
74
+
75
+ ()
76
+ }
77
+ test(" test12" ){
78
+ def xx (body : => Int )(rest: Int ) = body == rest
79
+ val partiallyAppliedByName = xx{
80
+ assert(1 == 2 )
81
+ 1
82
+ }
83
+
84
+ partiallyAppliedByName(2 )
85
+ ()
86
+ }
44
87
}
45
88
89
+ private case class Obj (arg: Int ) {
90
+ def method [T ](tester : Obj => T ): T = tester(this )
91
+ val elem = " elem"
92
+ }
46
93
val testBody = {
47
94
48
95
val results = TestRunner .run(
@@ -59,6 +106,11 @@ object LineNumbersTests extends utest.TestSuite {
59
106
stackTraceLinesFromThisFile(4 ).exists(_.getLineNumber == 28 ),
60
107
stackTraceLinesFromThisFile(5 ).exists(_.getLineNumber == 33 ),
61
108
stackTraceLinesFromThisFile(6 ).exists(_.getLineNumber == 38 ),
109
+ stackTraceLinesFromThisFile(7 ).exists(_.getLineNumber == 47 ),
110
+ stackTraceLinesFromThisFile(8 ).exists(_.getLineNumber == 58 ),
111
+ stackTraceLinesFromThisFile(9 ).exists(_.getLineNumber == 66 ),
112
+ stackTraceLinesFromThisFile(10 ).exists(_.getLineNumber == 71 ),
113
+ stackTraceLinesFromThisFile(11 ).exists(_.getLineNumber == 80 ),
62
114
)
63
115
64
116
}
0 commit comments