Skip to content

Commit 3457006

Browse files
authored
Remove fewer braces syntax for now (#2801)
1 parent 0b31d2d commit 3457006

7 files changed

+28
-14
lines changed

_overviews/toolkit/testing-asynchronous.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ class AsyncMathLibTests extends munit.FunSuite {
6868
import scala.concurrent.ExecutionContext.Implicits.global
6969

7070
class AsyncMathLibTests extends munit.FunSuite:
71-
test("square"):
71+
test("square") {
7272
for
7373
squareOf3 <- AsyncMathLib.square(3)
7474
squareOfMinus4 <- AsyncMathLib.square(-4)
7575
yield
7676
assertEquals(squareOf3, 9)
7777
assertEquals(squareOfMinus4, 16)
78+
}
7879
```
7980
{% endtab %}
8081
{% endtabs %}

_overviews/toolkit/testing-exceptions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ class FileTests extends munit.FunSuite {
3434
import java.nio.file.NoSuchFileException
3535

3636
class FileTests extends munit.FunSuite:
37-
test("read missing file"):
37+
test("read missing file") {
3838
val missingFile = os.pwd / "missing.txt"
39-
intercept[NoSuchFileException]:
39+
intercept[NoSuchFileException] {
4040
// the code that should throw an exception
4141
os.read(missingFile)
42+
}
43+
}
4244
```
4345
{% endtab %}
4446
{% endtabs %}

_overviews/toolkit/testing-resources.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ using2TempFiles.test("merge two files") {
8282
val using2TempFiles: FunFixture[(os.Path, os.Path)] =
8383
FunFixture.map2(usingTempFile, usingTempFile)
8484

85-
using2TempFiles.test("merge two files"):
85+
using2TempFiles.test("merge two files") {
8686
(file1, file2) =>
8787
// body of the test
88+
}
8889
```
8990
{% endtab %}
9091
{% endtabs %}

_overviews/toolkit/testing-run-only.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ class MathSuite extends munit.FunSuite {
5353
{% tab 'Scala 3' %}
5454
```scala
5555
class MathSuite extends munit.FunSuite:
56-
test("addition"):
56+
test("addition") {
5757
assert(1 + 1 == 2)
58-
test("multiplication".only):
58+
}
59+
test("multiplication".only) {
5960
assert(3 * 7 == 21)
61+
}
6062
```
6163
{% endtab %}
6264
{% endtabs %}
@@ -88,12 +90,15 @@ class MathSuite extends munit.FunSuite {
8890
{% tab 'Scala 3' %}
8991
```scala
9092
class MathSuite extends munit.FunSuite:
91-
test("addition".ignore):
93+
test("addition".ignore) {
9294
assert(1 + 1 == 2)
93-
test("multiplication"):
95+
}
96+
test("multiplication") {
9497
assert(3 * 7 == 21)
95-
test("remainder"):
98+
}
99+
test("remainder") {
96100
assert(13 % 5 == 3)
101+
}
97102
```
98103
{% endtab %}
99104
{% endtabs %}

_overviews/toolkit/testing-run.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ test("failing test") {
6262
{% endtab %}
6363
{% tab 'Scala 3' %}
6464
```scala
65-
test("failing test"):
65+
test("failing test") {
6666
val obtained = 2 + 3
6767
val expected = 4
6868
assertEquals(obtained, expected)
69+
}
6970
```
7071
{% endtab %}
7172
{% endtabs %}

_overviews/toolkit/testing-suite.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ class MyTests extends munit.FunSuite {
7878
package example
7979

8080
class MyTests extends munit.FunSuite:
81-
test("sum of two integers"):
81+
test("sum of two integers") {
8282
val obtained = 2 + 2
8383
val expected = 4
8484
assertEquals(obtained, expected)
85+
}
8586
```
8687
{% endtab %}
8788
{% endtabs %}
@@ -115,11 +116,12 @@ test("all even numbers") {
115116
{% endtab %}
116117
{% tab 'Scala 3' %}
117118
```scala
118-
test("all even numbers"):
119+
test("all even numbers") {
119120
val input: List[Int] = List(1, 2, 3, 4)
120121
val obtainedResults: List[Int] = input.map(_ * 2)
121122
// check that obtained values are all even numbers
122123
assert(obtainedResults.forall(x => x % 2 == 0))
124+
}
123125
```
124126
{% endtab %}
125127
{% endtabs %}

_overviews/toolkit/testing-what-else.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ test("home directory") {
4949
```scala
5050
import scala.util.Properties
5151

52-
test("home directory"):
52+
test("home directory") {
5353
assume(Properties.isLinux, "this test runs only on Linux")
5454
assert(os.home.toString.startsWith("/home/"))
55+
}
5556
```
5657
{% endtab %}
5758
{% endtabs %}
@@ -73,8 +74,9 @@ test("requests".flaky) {
7374
{% endtab %}
7475
{% tab 'Scala 3' %}
7576
```scala
76-
test("requests".flaky):
77+
test("requests".flaky) {
7778
// I/O heavy tests that sometimes fail
79+
}
7880
```
7981
{% endtab %}
8082
{% endtabs %}

0 commit comments

Comments
 (0)