-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for scala-native and scalajs 1.0
- Loading branch information
1 parent
46775cf
commit 332474a
Showing
6 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea/ | ||
target/ | ||
*.hnir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
js/src/test/scala/io/estatico/newtype/macros/NonNativeNewTypeMacrosTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.estatico.newtype.macros | ||
|
||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import io.estatico.newtype.ops._ | ||
import org.scalacheck.Arbitrary | ||
|
||
class NonNativeNewTypeMacrosTest extends AnyFlatSpec with Matchers { | ||
|
||
import NewTypeMacrosTest._ | ||
|
||
behavior of "@newtype with type bounds" | ||
|
||
it should "enforce type bounds" in { | ||
val x = Sub(new java.util.HashMap[String, Int]): Sub[java.util.HashMap[String, Int]] | ||
val y = Sub(new java.util.concurrent.ConcurrentHashMap[String, Int]) | ||
|
||
assertCompiles("x: Sub[java.util.HashMap[String, Int]]") | ||
assertCompiles("y: Sub[java.util.concurrent.ConcurrentHashMap[String, Int]]") | ||
|
||
assertDoesNotCompile("x: Sub[java.util.concurrent.ConcurrentHashMap[String, Int]]") | ||
assertDoesNotCompile("y: Sub[java.util.HashMap[String, Int]]") | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
jvm/src/test/scala/io/estatico/newtype/macros/NonNativeNewTypeMacrosTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.estatico.newtype.macros | ||
|
||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import io.estatico.newtype.ops._ | ||
import org.scalacheck.Arbitrary | ||
|
||
class NonNativeNewTypeMacrosTest extends AnyFlatSpec with Matchers { | ||
|
||
import NewTypeMacrosTest._ | ||
|
||
behavior of "@newtype with type bounds" | ||
|
||
it should "enforce type bounds" in { | ||
val x = Sub(new java.util.HashMap[String, Int]): Sub[java.util.HashMap[String, Int]] | ||
val y = Sub(new java.util.concurrent.ConcurrentHashMap[String, Int]) | ||
|
||
assertCompiles("x: Sub[java.util.HashMap[String, Int]]") | ||
assertCompiles("y: Sub[java.util.concurrent.ConcurrentHashMap[String, Int]]") | ||
|
||
assertDoesNotCompile("x: Sub[java.util.concurrent.ConcurrentHashMap[String, Int]]") | ||
assertDoesNotCompile("y: Sub[java.util.HashMap[String, Int]]") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters