Skip to content

Commit 593e07b

Browse files
committed
Fix a bunch of style issues discovered by Scalastyle.
1 parent 0141889 commit 593e07b

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

js-envs/src/test/scala/org/scalajs/jsenv/test/AsyncTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trait AsyncTests {
2828
}
2929

3030
@Test
31-
def futureTest = {
31+
def futureTest: Unit = {
3232
val runner = asyncRunner("")
3333
val fut = runner.start()
3434

@@ -38,7 +38,7 @@ trait AsyncTests {
3838
}
3939

4040
@Test
41-
def stopAfterTerminatedTest = {
41+
def stopAfterTerminatedTest: Unit = {
4242
val runner = asyncRunner("")
4343
val fut = runner.start()
4444

js-envs/src/test/scala/org/scalajs/jsenv/test/ComTests.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ trait ComTests extends AsyncTests {
3636
}
3737

3838
@Test
39-
def comCloseJVMTest = {
39+
def comCloseJVMTest: Unit = {
4040
val com = comRunner(s"""
4141
scalajsCom.init(function(msg) { scalajsCom.send("received: " + msg); });
4242
scalajsCom.send("Hello World");
@@ -57,7 +57,7 @@ trait ComTests extends AsyncTests {
5757
com.stop() // should do nothing, and not fail
5858
}
5959

60-
def comCloseJSTestCommon(timeout: Long) = {
60+
def comCloseJSTestCommon(timeout: Long): Unit = {
6161
val com = comRunner(s"""
6262
scalajsCom.init(function(msg) {});
6363
for (var i = 0; i < 10; ++i)
@@ -82,13 +82,13 @@ trait ComTests extends AsyncTests {
8282
}
8383

8484
@Test
85-
def comCloseJSTest = comCloseJSTestCommon(0)
85+
def comCloseJSTest: Unit = comCloseJSTestCommon(0)
8686

8787
@Test
88-
def comCloseJSTestDelayed = comCloseJSTestCommon(1000)
88+
def comCloseJSTestDelayed: Unit = comCloseJSTestCommon(1000)
8989

9090
@Test
91-
def doubleCloseTest = {
91+
def doubleCloseTest: Unit = {
9292
val n = 10
9393
val com = pingPongRunner(n)
9494

@@ -104,7 +104,7 @@ trait ComTests extends AsyncTests {
104104
}
105105

106106
@Test
107-
def multiEnvTest = {
107+
def multiEnvTest: Unit = {
108108
val n = 10
109109
val envs = List.fill(5)(pingPongRunner(10))
110110

@@ -137,7 +137,7 @@ trait ComTests extends AsyncTests {
137137
}
138138

139139
@Test
140-
def largeMessageTest = {
140+
def largeMessageTest: Unit = {
141141
// 1KB data
142142
val baseMsg = new String(Array.tabulate(512)(_.toChar))
143143
val baseLen = baseMsg.length
@@ -178,7 +178,7 @@ trait ComTests extends AsyncTests {
178178
}
179179

180180
@Test
181-
def highCharTest = { // #1536
181+
def highCharTest: Unit = { // #1536
182182
val com = comRunner("""
183183
scalajsCom.init(scalajsCom.send);
184184
""")
@@ -195,7 +195,7 @@ trait ComTests extends AsyncTests {
195195
}
196196

197197
@Test
198-
def noInitTest = {
198+
def noInitTest: Unit = {
199199
val com = comRunner("")
200200

201201
com.start()
@@ -205,7 +205,7 @@ trait ComTests extends AsyncTests {
205205
}
206206

207207
@Test
208-
def stopTestCom = {
208+
def stopTestCom: Unit = {
209209
val com = comRunner(s"""scalajsCom.init(function(msg) {});""")
210210

211211
com.start()
@@ -227,7 +227,7 @@ trait ComTests extends AsyncTests {
227227
}
228228

229229
@Test
230-
def futureStopTest = {
230+
def futureStopTest: Unit = {
231231
val com = comRunner(s"""scalajsCom.init(function(msg) {});""")
232232

233233
val fut = com.start()

js-envs/src/test/scala/org/scalajs/jsenv/test/CustomInitFilesTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class CustomInitFilesTest extends JSEnvTest {
1818
}
1919

2020
@Test
21-
def customInitFilesTest = {
21+
def customInitFilesTest: Unit = {
2222
"""
2323
customPrint("hello");
2424
""" hasOutput
@@ -28,13 +28,13 @@ abstract class CustomInitFilesTest extends JSEnvTest {
2828
}
2929

3030
class NodeJSWithCustomInitFilesTest extends CustomInitFilesTest {
31-
protected def newJSEnv = new NodeJSEnv {
31+
protected def newJSEnv: NodeJSEnv = new NodeJSEnv {
3232
override def customInitFiles() = makeCustomInitFiles()
3333
}
3434
}
3535

3636
class PhantomJSWithCustomInitFilesTest extends CustomInitFilesTest {
37-
protected def newJSEnv = new PhantomJSEnv {
37+
protected def newJSEnv: PhantomJSEnv = new PhantomJSEnv {
3838
override def customInitFiles() = makeCustomInitFiles()
3939
}
4040
}

js-envs/src/test/scala/org/scalajs/jsenv/test/NodeJSTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import org.junit.Assert._
77

88
class NodeJSTest extends TimeoutComTests {
99

10-
protected def newJSEnv = new NodeJSEnv
10+
protected def newJSEnv: NodeJSEnv = new NodeJSEnv
1111

1212
/** Node.js strips double percentage signs - #500 */
1313
@Test
14-
def percentageTest = {
14+
def percentageTest: Unit = {
1515
val counts = 1 to 15
1616
val argcs = 1 to 3
1717
val strings = counts.map("%" * _)
@@ -35,7 +35,7 @@ class NodeJSTest extends TimeoutComTests {
3535

3636
/** Node.js console.log hack didn't allow to log non-Strings - #561 */
3737
@Test
38-
def nonStringTest = {
38+
def nonStringTest: Unit = {
3939

4040
"""
4141
console.log(1);
@@ -53,7 +53,7 @@ class NodeJSTest extends TimeoutComTests {
5353
}
5454

5555
@Test
56-
def slowJSEnvTest = {
56+
def slowJSEnvTest: Unit = {
5757
val com = comRunner("""
5858
setTimeout(function() {
5959
scalajsCom.init(function(msg) {

js-envs/src/test/scala/org/scalajs/jsenv/test/TimeoutComTests.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.concurrent.duration._
99
trait TimeoutComTests extends TimeoutTests with ComTests {
1010

1111
@Test
12-
def delayedInitTest = {
12+
def delayedInitTest: Unit = {
1313

1414
val com = comRunner(s"""
1515
setTimeout(function() {
@@ -35,7 +35,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
3535
}
3636

3737
@Test
38-
def delayedReplyTest = {
38+
def delayedReplyTest: Unit = {
3939

4040
val com = comRunner(s"""
4141
scalajsCom.init(function(msg) {
@@ -58,7 +58,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
5858
}
5959

6060
@Test
61-
def receiveTimeoutTest = {
61+
def receiveTimeoutTest: Unit = {
6262

6363
val com = comRunner(s"""
6464
scalajsCom.init(function(msg) {
@@ -85,7 +85,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
8585
}
8686

8787
@Test
88-
def intervalSendTest = {
88+
def intervalSendTest: Unit = {
8989

9090
val com = comRunner(s"""
9191
scalajsCom.init(function(msg) {});
@@ -108,7 +108,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
108108
}
109109

110110
@Test
111-
def noMessageTest = {
111+
def noMessageTest: Unit = {
112112
val com = comRunner(s"""
113113
// Make sure JVM has already closed when we init
114114
setTimeout(scalajsCom.init, 1000, function(msg) {});
@@ -119,7 +119,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
119119
}
120120

121121
@Test
122-
def stopTestTimeout = {
122+
def stopTestTimeout: Unit = {
123123

124124
val async = asyncRunner(s"""
125125
setInterval(function() {}, 0);
@@ -140,7 +140,7 @@ trait TimeoutComTests extends TimeoutTests with ComTests {
140140
}
141141

142142
@Test
143-
def doubleStopTest = {
143+
def doubleStopTest: Unit = {
144144
val async = asyncRunner(s"""
145145
setInterval(function() {}, 0);
146146
""")

js-envs/src/test/scala/org/scalajs/jsenv/test/TimeoutTests.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import scala.concurrent.duration._
88
trait TimeoutTests extends JSEnvTest {
99

1010
@Test
11-
def basicTimeoutTest = {
11+
def basicTimeoutTest: Unit = {
1212

1313
val deadline = 300.millis.fromNow
1414

@@ -29,7 +29,7 @@ trait TimeoutTests extends JSEnvTest {
2929
}
3030

3131
@Test
32-
def clearTimeoutTest = {
32+
def clearTimeoutTest: Unit = {
3333

3434
val deadline = 300.millis.fromNow
3535

@@ -52,7 +52,7 @@ trait TimeoutTests extends JSEnvTest {
5252
}
5353

5454
@Test
55-
def timeoutArgTest = {
55+
def timeoutArgTest: Unit = {
5656

5757
val deadline = 300.millis.fromNow
5858

@@ -73,7 +73,7 @@ trait TimeoutTests extends JSEnvTest {
7373
}
7474

7575
@Test
76-
def intervalTest = {
76+
def intervalTest: Unit = {
7777

7878
val deadline = 1.second.fromNow
7979

@@ -109,7 +109,7 @@ trait TimeoutTests extends JSEnvTest {
109109
}
110110

111111
@Test
112-
def intervalSelfClearTest = {
112+
def intervalSelfClearTest: Unit = {
113113

114114
val deadline = 100.millis.fromNow
115115

0 commit comments

Comments
 (0)