diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-09 12:15:13 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-09 12:15:13 +0100 |
commit | 08e51dfec50842253afb87cc5ae3c7400dc18ced (patch) | |
tree | 7655825529e7690195bd92e13494d44c6d4bf223 /test/files/neg/stringinterpolation_macro-neg.scala | |
parent | 21a765feb0efeeecd671ede637a12f5088ac8257 (diff) | |
parent | ab7a8bcdb50128bfe2ac6d9d04e560593a3131ef (diff) | |
download | scala-08e51dfec50842253afb87cc5ae3c7400dc18ced.tar.gz scala-08e51dfec50842253afb87cc5ae3c7400dc18ced.tar.bz2 scala-08e51dfec50842253afb87cc5ae3c7400dc18ced.zip |
Merge pull request #3420 from som-snytt/issue/8092-f-parsing
SI-8092 More verify for f-interpolator
Diffstat (limited to 'test/files/neg/stringinterpolation_macro-neg.scala')
-rw-r--r-- | test/files/neg/stringinterpolation_macro-neg.scala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/files/neg/stringinterpolation_macro-neg.scala b/test/files/neg/stringinterpolation_macro-neg.scala index ac9d97d678..3869d42d66 100644 --- a/test/files/neg/stringinterpolation_macro-neg.scala +++ b/test/files/neg/stringinterpolation_macro-neg.scala @@ -3,6 +3,11 @@ object Test extends App { 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() @@ -28,4 +33,44 @@ object Test extends App { } 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" } |