-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from dwijnand/tuple-syntax
Implement Tuple syntax on LList
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 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
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,19 @@ | ||
package sjsonnew | ||
|
||
import org.scalatest.FlatSpec | ||
import BasicJsonProtocol._ | ||
|
||
final class LListSpec extends FlatSpec { | ||
private val anLList = "age" -> 23 :*: "name" -> "foo" :*: LNil | ||
|
||
behavior of s"$anLList" | ||
|
||
it should "have _1 === 23" in assert(anLList._1 === 23) | ||
it should "have _1 !== 42" in assert(anLList._1 !== 42) | ||
|
||
it should "have _2 === foo" in assert(anLList._2 === "foo") | ||
it should "have _2 !== bar" in assert(anLList._2 !== "bar") | ||
|
||
it should "type error on _3" in assertTypeError("""("age" -> 23 :*: "name" -> "foo" :*: LNil)._3""") | ||
it should "compile on _2" in assertCompiles("""("age" -> 23 :*: "name" -> "foo" :*: LNil)._2""") | ||
} |