8000 Merge pull request #28 from scala-wasm/junit-runtime-assert · sjrd/scala-js@59395e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 59395e7

Browse files
authored
Merge pull request #28 from scala-wasm/junit-runtime-assert
test-suite-wasi to use org.junit (junit-runtime)
2 parents 2291fdf + 5535495 commit 59395e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+76
-707
lines changed

examples/test-suite-wasi/src/main/scala/test-suites-wasi/CompilerTest.scala

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ import compiler._
44

55
object CompilerTest {
66
def run(): Unit = {
7-
// TODO: ArrayTest
7+
locally {
8+
val test = new ArrayTest
9+
import test._
10+
getArrayIndexOutOfBounds()
11+
setArrayIndexOutOfBounds()
12+
// TODO
13+
// setArrayStoreExceptions()
14+
arraySelectSideEffecting_Issue3848()
15+
negativeArraySizes()
16+
genericArrayNullsShortCircuited_Issue4755()
17+
}
818
BooleanTest.bitwiseAndOrXorOperators()
919
ByteTest.toByteAndToCharAreInRange()
1020
CharTest.toIntNegativeToPositive()
@@ -28,9 +38,8 @@ object CompilerTest {
2838
test.minus()
2939
test.times()
3040
test.division()
31-
// TODO: assert throws
32-
// intTest.divisionByZero()
33-
// intTest.moduloByZero()
41+
test.divisionByZero()
42+
test.moduloByZero()
3443
test.remainderNegative0_Issue1984()
3544
test.shiftLeft()
3645
test.shiftRight()

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/ArrayTest.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package testSuiteWASI.compiler
1414

1515
import testSuiteWASI.utils.AssertThrows.assertThrows
16-
import testSuiteWASI.junit.Assert._
16+
import org.junit.Assert._
1717
import testSuiteWASI.Platform._
1818

1919
class ArrayTest {
@@ -127,7 +127,6 @@ class ArrayTest {
127127
assertEquals(5, c(1))
128128
assertThrows(classOf[ArrayStoreException], c(1) = java.lang.Double.valueOf(5.5))
129129
assertEquals(5, c(1))
130-
/*
131130
if (executingInJVM) {
132131
assertThrows(classOf[ArrayStoreException], c(2) = java.lang.Double.valueOf(5.0))
133132
assertNull(c(2))
@@ -161,7 +160,6 @@ class ArrayTest {
161160
assertThrows(classOf[ArrayStoreException], y(3) = str)
162161
y(1) = null
163162
assertNull(y(1))
164-
*/
165163
}
166164

167165

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/BooleanTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
object BooleanTest {
1818
def bitwiseAndOrXorOperators(): Unit = {

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/ByteTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
object ByteTest {
1818

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/CharTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
object CharTest {
1818
def toIntNegativeToPositive(): Unit = {

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/ClassDiffersOnlyInCaseTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
object ClassDiffersOnlyInCaseTest {
1818
def testClassesThatDifferOnlyInCase_Issue4855(): Unit = {

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/DefaultMethodsTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
// import org.junit.Assume._
1818

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/DoubleTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
class DoubleTest {
1818
final def assertExactEquals(expected: Double, actual: Double): Unit =

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/FloatTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
1616

1717
class FloatTest {
1818
final def assertExactEquals(expected: Float, actual: Float): Unit =

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/IntTest.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
package testSuiteWASI.compiler
1414

15-
import testSuiteWASI.junit.Assert._
15+
import org.junit.Assert._
16+
import testSuiteWASI.utils.AssertThrows.assertThrows
1617

1718
// import org.scalajs.testsuite.utils.Platform
1819
// import org.scalajs.testsuite.utils.AssertThrows.assertThrows
@@ -287,9 +288,7 @@ class IntTest {
287288
test(AlmostMaxVal, -123, AlmostMaxVal / -123)
288289
}
289290

290-
// TODO
291-
/*
292-
@Test def divisionByZero(): Unit = {
291+
def divisionByZero(): Unit = {
293292
@noinline def divNoInline(x: Int, y: Int): Int = x / y
294293

295294
@inline def divInline(x: Int, y: Int): Int = x / y
@@ -308,10 +307,7 @@ class IntTest {
308307
// Eligible for constant-folding by scalac itself
309308
assertThrows(classOf[ArithmeticException], 5 / 0)
310309
}
311-
*/
312310

313-
// TODO
314-
/*
315311
def moduloByZero(): Unit = {
316312
@noinline def modNoInline(x: Int, y: 341A Int): Int = x % y
317313

@@ -331,7 +327,6 @@ class IntTest {
331327
// Eligible for constant-folding by scalac itself
332328
assertThrows(classOf[ArithmeticException], 5 % 0)
333329
}
334-
*/
335330

336331
def remainderNegative0_Issue1984(): Unit = {
337332
@noinline def value: Int = -8

0 commit comments

Comments
 (0)
0