Skip to content

Commit 3248227

Browse files
author
Antoine Brunner
committed
Add a new folder for test files
1 parent f517abe commit 3248227

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(1,2,3,4,5)
2+
(1,2,3,4,5)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
object Test extends App {
3+
val emptyTuple: Tuple = ()
4+
val tuple1: Tuple = ("1", "2", "3", "4", "5")
5+
val tuple2: Tuple = ("6", "7", "8", "9", "10")
6+
val tupleXXL1: Tuple = ("11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35")
7+
val tupleXXL2: Tuple = ("36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60")
8+
9+
// Try all possible kinds of concatenations (small === <=22):
10+
// empty + empty
11+
// small + empty
12+
// empty + small
13+
// xxl + empty
14+
// empty + xxl
15+
// small + small
16+
// small + xxl
17+
// xxl + small
18+
// xxl + xxl
19+
println(tuple1 ++ emptyTuple)
20+
println(emptyTuple ++ tuple1)
21+
22+
// Concatenation with an empty tuple should be a no-op
23+
assert((tuple1 ++ emptyTuple).asInstanceOf[AnyRef] eq tuple1.asInstanceOf[AnyRef])
24+
assert((tupleXXL1 ++ emptyTuple).asInstanceOf[AnyRef] eq tupleXXL1.asInstanceOf[AnyRef])
25+
assert((emptyTuple ++tuple1).asInstanceOf[AnyRef] eq tuple1.asInstanceOf[AnyRef])
26+
assert((emptyTuple ++ tupleXXL1).asInstanceOf[AnyRef] eq tupleXXL1.asInstanceOf[AnyRef])
27+
}

0 commit comments

Comments
 (0)