Skip to content

Commit

Permalink
Merge pull request #377 from scala-native/topic/fix-376
Browse files Browse the repository at this point in the history
Test that #376 is not reproducible
  • Loading branch information
densh committed Nov 8, 2016
2 parents 27c8207 + 1072616 commit 94479c7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.scalanative.issues

object _260 extends tests.Suite {
test("https://github.com/scala-native/scala-native/issues/260") {
object _260Suite extends tests.Suite {
test("#260") {
def getStr(): String = {
val bytes = Array('h'.toByte, 'o'.toByte, 'l'.toByte, 'a'.toByte)
new String(bytes)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.scalanative.issues

object _314 extends tests.Suite {
test("github.com/scala-native/scala-native/issues/314") {
object _314Suite extends tests.Suite {
test("#314") {
// Division by zero is undefined behavior in production mode.
// Optimizer can assume it never happens and remove unused result.
assert {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.scalanative.issues

object _337 extends tests.Suite {
test("github.com/scala-native/scala-native/issues/337") {
object _337Suite extends tests.Suite {
test("#337") {
case class TestObj(value: Int)
val obj = TestObj(10)
assert(obj.value == 10)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.scalanative.issues

object _350 extends tests.Suite {
test("github.com/scala-native/scala-native/issues/350") {
object _350Suite extends tests.Suite {
test("#350") {
val div = java.lang.Long.divideUnsigned(42L, 2L)
assert(div == 21L)
}
Expand Down
12 changes: 12 additions & 0 deletions unit-tests/src/main/scala/scala/scalanative/issues/_376Suite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package scala.scalanative.issues

object _376Suite extends tests.Suite {
test("#376") {
val m = scala.collection.mutable.Map.empty[String, String]
val hello = "hello"
val world = "world"
m(hello) = world
val h = m.getOrElse(hello, "Failed !")
assert(h equals world)
}
}

0 comments on commit 94479c7

Please sign in to comment.