@@ -7,109 +7,109 @@ import org.junit.Assert.assertEquals
7
7
class DocTests extends ReplTest {
8
8
9
9
@ Test def docOfDef =
10
- eval(" /** doc */ def foo = 0" ).andThen { implicit s =>
10
+ eval(" /** doc */ def foo = 0" ).andThen {
11
11
assertEquals(" doc" , doc(" foo" ))
12
12
}
13
13
14
14
@ Test def docOfVal =
15
- eval(" /** doc */ val foo = 0" ).andThen { implicit s =>
15
+ eval(" /** doc */ val foo = 0" ).andThen {
16
16
assertEquals(" doc" , doc(" foo" ))
17
17
}
18
18
19
19
@ Test def docOfObject =
20
- eval(" /** doc */ object Foo" ).andThen { implicit s =>
20
+ eval(" /** doc */ object Foo" ).andThen {
21
21
assertEquals(" doc" , doc(" Foo" ))
22
22
}
23
23
24
24
@ Test def docOfClass =
25
- eval(" /** doc */ class Foo" ).andThen { implicit s =>
25
+ eval(" /** doc */ class Foo" ).andThen {
26
26
assertEquals(" doc" , doc(" new Foo" ))
27
27
}
28
28
29
29
@ Test def docOfTrait =
30
- eval(" /** doc */ trait Foo" ).andThen { implicit s =>
30
+ eval(" /** doc */ trait Foo" ).andThen {
31
31
assertEquals(" doc" , doc(" new Foo" ))
32
32
}
33
33
/*
34
34
@Test def docOfExtension1 =
35
- eval("/* * doc */ extension (x: Int) def foo = 0").andThen { implicit s =>
35
+ eval("/* * doc */ extension (x: Int) def foo = 0").andThen {
36
36
assertEquals("doc", doc("extension_foo"))
37
37
}
38
38
39
39
@Test def docOfExtension2 =
40
- eval("extension (x: Int) /* * doc */ def foo = 0").andThen { implicit s =>
40
+ eval("extension (x: Int) /* * doc */ def foo = 0").andThen {
41
41
assertEquals("doc", doc("extension_foo"))
42
42
}
43
43
44
44
@Test def docOfExtension3 =
45
- eval("/* * doc0 */ extension (x: Int) { /* * doc1 */ def foo = 0; /* * doc2 */ def bar = 0; def baz = 0 }").andThen { implicit s =>
45
+ eval("/* * doc0 */ extension (x: Int) { /* * doc1 */ def foo = 0; /* * doc2 */ def bar = 0; def baz = 0 }").andThen {
46
46
assertEquals("doc1", doc("extension_foo"))
47
47
assertEquals("doc2", doc("extension_bar"))
48
48
assertEquals("doc0", doc("extension_baz"))
49
49
}
50
50
*/
51
51
@ Test def docOfDefInObject =
52
- eval(" object O { /** doc */ def foo = 0 }" ).andThen { implicit s =>
52
+ eval(" object O { /** doc */ def foo = 0 }" ).andThen {
53
53
assertEquals(" doc" , doc(" O.foo" ))
54
54
}
55
55
56
56
@ Test def docOfValInObject =
57
- eval(" object O { /** doc */ val foo = 0 }" ).andThen { implicit s =>
57
+ eval(" object O { /** doc */ val foo = 0 }" ).andThen {
58
58
assertEquals(" doc" , doc(" O.foo" ))
59
59
}
60
60
61
61
@ Test def docOfObjectInObject =
62
- eval(" object O { /** doc */ object Foo }" ).andThen { implicit s =>
62
+ eval(" object O { /** doc */ object Foo }" ).andThen {
63
63
assertEquals(" doc" , doc(" O.Foo" ))
64
64
}
65
65
66
66
@ Test def docOfClassInObject =
67
- eval(" object O { /** doc */ class Foo }" ).andThen { implicit s =>
67
+ eval(" object O { /** doc */ class Foo }" ).andThen {
68
68
assertEquals(" doc" , doc(" new O.Foo" ))
69
69
}
70
70
71
71
@ Test def docOfTraitInObject =
72
- eval(" object O { /** doc */ trait Foo }" ).andThen { implicit s =>
72
+ eval(" object O { /** doc */ trait Foo }" ).andThen {
73
73
assertEquals(" doc" , doc(" new O.Foo" ))
74
74
}
75
75
76
76
@ Test def docOfDefInClass =
77
77
eval(
78
78
""" class C { /** doc */ def foo = 0 }
79
79
|val c = new C
80
- """ .stripMargin).andThen { implicit s =>
80
+ """ .stripMargin).andThen {
81
81
assertEquals(" doc" , doc(" c.foo" ))
82
82
}
83
83
84
84
@ Test def docOfValInClass =
85
85
eval(
86
86
""" class C { /** doc */ val foo = 0 }
87
87
|val c = new C
88
- """ .stripMargin).andThen { implicit s =>
88
+ """ .stripMargin).andThen {
89
89
assertEquals(" doc" , doc(" c.foo" ))
90
90
}
91
91
92
92
@ Test def docOfObjectInClass =
93
93
eval(
94
94
""" class C { /** doc */ object Foo }
95
95
|val c = new C
96
- """ .stripMargin).andThen { implicit s =>
96
+ """ .stripMargin).andThen {
97
97
assertEquals(" doc" , doc(" c.Foo" ))
98
98
}
99
99
100
100
@ Test def docOfClassInClass =
101
101
eval(
102
102
""" class C { /** doc */ class Foo }
103
103
|val c = new C
104
- """ .stripMargin).andThen { implicit s =>
104
+ """ .stripMargin).andThen {
105
105
assertEquals(" doc" , doc(" new c.Foo" ))
106
106
}
107
107
108
108
@ Test def docOfTraitInClass =
109
109
eval(
110
110
""" class C { /** doc */ trait Foo }
111
111
|val c = new C
112
- """ .stripMargin).andThen { implicit s =>
112
+ """ .stripMargin).andThen {
113
113
assertEquals(" doc" , doc(" new c.Foo" ))
114
114
}
115
115
@@ -119,7 +119,7 @@ class DocTests extends ReplTest {
119
119
| /** doc0 */ def foo(x: Int) = x
120
120
| /** doc1 */ def foo(x: String) = x
121
121
|}
122
- """ .stripMargin).andThen { implicit s =>
122
+ """ .stripMargin).andThen {
123
123
assertEquals(" doc0" , doc(" O.foo(_: Int)" ))
124
124
assertEquals(" doc1" , doc(" O.foo(_: String)" ))
125
125
}
@@ -128,7 +128,7 @@ class DocTests extends ReplTest {
128
128
eval(
129
129
""" class C { /** doc */ def foo = 0 }
130
130
|object O extends C
131
- """ .stripMargin).andThen { implicit s =>
131
+ """ .stripMargin).andThen {
132
132
assertEquals(" doc" , doc(" O.foo" ))
133
133
}
134
134
@@ -142,7 +142,7 @@ class DocTests extends ReplTest {
142
142
| override def foo(x: Int): Int = x
143
143
| /** overridden doc */ override def foo(x: String): String = x
144
144
|}
145
- """ .stripMargin).andThen { implicit s =>
145
+ """ .stripMargin).andThen {
146
146
assertEquals(" doc0" , doc(" O.foo(_: Int)" ))
147
147
assertEquals(" overridden doc" , doc(" O.foo(_: String)" ))
148
148
}
@@ -158,7 +158,7 @@ class DocTests extends ReplTest {
158
158
| override def bar: Int = 0
159
159
| }
160
160
|}
161
- """ .stripMargin).andThen { implicit s =>
161
+ """ .stripMargin).andThen {
162
162
assertEquals(" companion" , doc(" O.foo" ))
163
163
assertEquals(" doc0" , doc(" O.foo.bar" ))
164
164
}
@@ -173,18 +173,16 @@ class DocTests extends ReplTest {
173
173
| /** Expansion: $Variable */
174
174
| def hello = "world"
175
175
|}
176
- """ .stripMargin).andThen { implicit s =>
176
+ """ .stripMargin).andThen {
177
177
assertEquals(" Expansion: some-value" , doc(" Foo.hello" ))
178
178
}
179
179
180
- @ Test def docOfEmpty =
181
- fromInitialState { implicit s =>
180
+ @ Test def docOfEmpty = initially {
182
181
run(" :doc" )
183
182
assertEquals(" :doc <expression>" , storedOutput().trim)
184
183
}
185
184
186
- private def eval (code : String ): State =
187
- fromInitialState { implicit s => run(code) }
185
+ private def eval (code : String ): State = initially(run(code))
188
186
189
187
private def doc (expr : String )(implicit s : State ): String = {
190
188
storedOutput()
0 commit comments