aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/stringinterpolation_macro-neg.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-19 17:53:49 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-19 17:53:49 +0100
commitd51d08b444e0ea4a2c13b4daf0ce14b53bfbad89 (patch)
tree1d3a66fc0f5f839a561a2987159cb5b841b89257 /tests/untried/neg/stringinterpolation_macro-neg.scala
parent24ac35546c2c159403e91144e0e4add585ee9ae5 (diff)
downloaddotty-d51d08b444e0ea4a2c13b4daf0ce14b53bfbad89.tar.gz
dotty-d51d08b444e0ea4a2c13b4daf0ce14b53bfbad89.tar.bz2
dotty-d51d08b444e0ea4a2c13b4daf0ce14b53bfbad89.zip
move all tests in tests/untried/neg which use implicits to tests/untried/neg-with-implicits
Diffstat (limited to 'tests/untried/neg/stringinterpolation_macro-neg.scala')
-rw-r--r--tests/untried/neg/stringinterpolation_macro-neg.scala76
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/untried/neg/stringinterpolation_macro-neg.scala b/tests/untried/neg/stringinterpolation_macro-neg.scala
deleted file mode 100644
index 3869d42d6..000000000
--- a/tests/untried/neg/stringinterpolation_macro-neg.scala
+++ /dev/null
@@ -1,76 +0,0 @@
-object Test extends App {
- val s = "Scala"
- val d = 8
- val b = false
- val f = 3.14159
- val c = 'c'
- val t = new java.util.Date
- val x = new java.util.Formattable {
- def formatTo(ff: java.util.Formatter, g: Int, w: Int, p: Int): Unit = ff format "xxx"
- }
-
- // 1) number of arguments
- new StringContext().f()
- new StringContext("", " is ", "%2d years old").f(s)
- new StringContext("", " is ", "%2d years old").f(s, d, d)
- new StringContext("", "").f()
-
- // 2) Interpolation mismatches
- f"$s%b"
- f"$s%c"
- f"$f%c"
- f"$s%x"
- f"$b%d"
- f"$s%d"
- f"$f%o"
- f"$s%e"
- f"$b%f"
-
- {
- implicit val strToInt1 = (s: String) => 1
- implicit val strToInt2 = (s: String) => 2
- f"$s%d"
- }
-
- f"$s%i"
-
- // 3) flag mismatches
- f"$s%+ 0,(s"
- f"$c%#+ 0,(c"
- f"$d%#d"
- f"$d%,x"
- f"$d%+ (x"
- f"$f%,(a"
- f"$t%#+ 0,(tT"
-
- // 4) bad precisions
- f"$c%.2c"
- f"$d%.2d"
- f"%.2%"
- f"%.2n"
- f"$f%.2a"
- f"$t%.2tT"
-
- // 5) bad indexes
- f"%<s"
- f"%<c"
- f"%<tT"
- f"${8}%d ${9}%d%3$$d"
- f"${8}%d ${9}%d%0$$d"
-
- // warnings
- f"${8}%d ${9}%1$$d"
- f"$s%s $s%s %1$$<s"
- f"$s%s $s%1$$s"
-
- // 6) bad arg types
- f"$s%#s"
-
- // 7) misunderstood conversions
- f"$t%tG"
- f"$t%t"
- f"$s%10.5"
-
- // 8) other brain failures
- f"${d}random-leading-junk%d"
-}