-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3427) Again starting with the test, passing in Scala 2 Let us see if I will be able to fix it, this time I am not yet sure where to start.
- Loading branch information
1 parent
08d3fb1
commit a7a8828
Showing
2 changed files
with
70 additions
and
15 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
47 changes: 47 additions & 0 deletions
47
airframe-surface/src/test/scala/wvlet/airframe/surface/i3418.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,47 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package wvlet.airframe.surface | ||
|
||
import wvlet.airspec.AirSpec | ||
|
||
object i3418 extends AirSpec { | ||
|
||
case class A[P](data: List[(String, P)]) | ||
case class AA[T, P](data: List[(T, P)]) | ||
|
||
case class S(a: A[Int]) | ||
case class SS(a: AA[String, Long]) | ||
|
||
test("Support generic List of tuples") { | ||
val s = Surface.of[S] | ||
debug(s.params) | ||
s.params.size shouldBe 1 | ||
val p1 = s.params(0) | ||
p1.name shouldBe "a" | ||
val a1 = p1.surface.params(0) | ||
a1.name shouldBe "data" | ||
a1.surface.name shouldBe "List[Tuple2[String,Int]]" | ||
} | ||
|
||
test("Support generic List of tuples with two type parameters") { | ||
val s = Surface.of[SS] | ||
debug(s.params) | ||
s.params.size shouldBe 1 | ||
val p1 = s.params(0) | ||
p1.name shouldBe "a" | ||
val a1 = p1.surface.params(0) | ||
a1.name shouldBe "data" | ||
a1.surface.name shouldBe "List[Tuple2[String,Long]]" | ||
} | ||
} |