summaryrefslogtreecommitdiff
path: root/scalatexApi/src/test/scala/scalatex/ParserTests.scala
diff options
context:
space:
mode:
authorLi Haoyi <haoyi@dropbox.com>2014-11-05 20:42:42 -0800
committerLi Haoyi <haoyi@dropbox.com>2014-11-05 20:42:42 -0800
commitc7d96c649cf2b2832a597df405f3c1afcd674009 (patch)
tree3aca3cf0c316a4ed08039c009bbd22ff7c1097b6 /scalatexApi/src/test/scala/scalatex/ParserTests.scala
parent8e8f9bb1d2e05d946ba55e273027d05345057d4d (diff)
downloadhands-on-scala-js-c7d96c649cf2b2832a597df405f3c1afcd674009.tar.gz
hands-on-scala-js-c7d96c649cf2b2832a597df405f3c1afcd674009.tar.bz2
hands-on-scala-js-c7d96c649cf2b2832a597df405f3c1afcd674009.zip
A bunch of error tests work, trimming is causing problems with multi-line error messages
Diffstat (limited to 'scalatexApi/src/test/scala/scalatex/ParserTests.scala')
-rw-r--r--scalatexApi/src/test/scala/scalatex/ParserTests.scala54
1 files changed, 28 insertions, 26 deletions
diff --git a/scalatexApi/src/test/scala/scalatex/ParserTests.scala b/scalatexApi/src/test/scala/scalatex/ParserTests.scala
index 150f766..401cfae 100644
--- a/scalatexApi/src/test/scala/scalatex/ParserTests.scala
+++ b/scalatexApi/src/test/scala/scalatex/ParserTests.scala
@@ -123,28 +123,28 @@ object ParserTests extends utest.TestSuite{
* - check("{i @am a @cow}", _.BraceBlock.run(),
Block(Seq(
Block.Text("i "),
- Chain("am",Seq()),
+ Chain("am",Seq(), 3),
Block.Text(" a "),
- Chain("cow",Seq())
+ Chain("cow",Seq(), 9)
))
)
}
'Chain{
* - check("@omg.bbq[omg].fff[fff](123) ", _.ScalaChain.run(),
Chain("omg",Seq(
- Chain.Prop("bbq"),
- Chain.TypeArgs("[omg]"),
- Chain.Prop("fff"),
- Chain.TypeArgs("[fff]"),
- Chain.Args("(123)")
+ Chain.Prop("bbq", 4),
+ Chain.TypeArgs("[omg]", 8),
+ Chain.Prop("fff", 13),
+ Chain.TypeArgs("[fff]", 17),
+ Chain.Args("(123)", 22)
))
)
* - check("@omg{bbq}.cow(moo){a @b}\n", _.ScalaChain.run(),
Chain("omg",Seq(
Block(Seq(Block.Text("bbq"))),
- Chain.Prop("cow"),
- Chain.Args("(moo)"),
- Block(Seq(Block.Text("a "), Chain("b", Nil)))
+ Chain.Prop("cow", 9),
+ Chain.Args("(moo)", 13),
+ Block(Seq(Block.Text("a "), Chain("b", Nil, 21)))
))
)
}
@@ -240,7 +240,7 @@ object ParserTests extends utest.TestSuite{
Text("\n "), Text("Hello"), Text("\n "))),
Some(Block(Vector(
Text("\n "), Text("lols"), Text("\n "))))
- ))))),
+ )))), 1),
Text("\n")
))
assert(res == expected)
@@ -276,10 +276,10 @@ object ParserTests extends utest.TestSuite{
Text("\n "),
Chain("bbq",Seq(Block(Seq(
Text("\n "),
- Chain("lol",Seq())
- ))))
- ))))
- ))))
+ Chain("lol",Seq(), 16)
+ ))), 12)
+ ))), 8)
+ ))), 1)
))
)
'dedents - check(
@@ -293,11 +293,11 @@ object ParserTests extends utest.TestSuite{
Chain("omg",Seq(Block(
Seq(
Text("\n "),
- Chain("wtf",Seq())
+ Chain("wtf",Seq(), 8)
)
- ))),
+ )), 1),
Text("\n"),
- Chain("bbq", Seq())
+ Chain("bbq", Seq(), 13)
))
)
'braces - check(
@@ -312,12 +312,12 @@ object ParserTests extends utest.TestSuite{
Chain("omg",Seq(Block(
Seq(
Text("\n "),
- Chain("wtf",Seq()),
+ Chain("wtf",Seq(), 9),
Text("\n")
)
- ))),
+ )), 1),
Text("\n"),
- Chain("bbq", Seq())
+ Chain("bbq", Seq(), 16)
))
)
'dedentText - check(
@@ -329,11 +329,12 @@ object ParserTests extends utest.TestSuite{
Block(Seq(
Text("\n"),
Chain("omg",Seq(
- Args("""("lol", 1, 2)"""),
+ Args("""("lol", 1, 2)""", 5),
Block(Seq(
Text("\n "),
- Chain("wtf",Seq())))
- )),
+ Chain("wtf",Seq(), 21)
+ ))
+ ), 1),
Text("\n"),
Text("bbq")
))
@@ -368,13 +369,14 @@ object ParserTests extends utest.TestSuite{
_.Body.run(),
Block(Seq(
Text("\n"),
- Chain("{\"lol\" * 3}", Seq()),
+ Chain("{\"lol\" * 3}", Seq(), 1),
Text("\n"),
Chain("""{
| val omg = "omg"
| omg * 2
|}""".stripMargin,
- Seq()
+ Seq(),
+ 14
)
))
)