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/run | |
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/run')
-rw-r--r-- | test/files/run/stringinterpolation_macro-run.check | 5 | ||||
-rw-r--r-- | test/files/run/stringinterpolation_macro-run.scala | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/stringinterpolation_macro-run.check b/test/files/run/stringinterpolation_macro-run.check index be62c5780b..ead61e76ac 100644 --- a/test/files/run/stringinterpolation_macro-run.check +++ b/test/files/run/stringinterpolation_macro-run.check @@ -46,6 +46,8 @@ S 120 120 120 + 0X4 +She is 4 feet tall. 120 42 3.400000e+00 @@ -60,3 +62,6 @@ S 05/26/12 05/26/12 05/26/12 +% +7 7 9 +7 9 9 diff --git a/test/files/run/stringinterpolation_macro-run.scala b/test/files/run/stringinterpolation_macro-run.scala index 1138cd0860..ff779dd1d3 100644 --- a/test/files/run/stringinterpolation_macro-run.scala +++ b/test/files/run/stringinterpolation_macro-run.scala @@ -72,6 +72,14 @@ println(f"${120 : java.lang.Integer}%d") println(f"${120 : java.lang.Long}%d") println(f"${BigInt(120)}%d") println(f"${new java.math.BigInteger("120")}%d") +println(f"${4}%#10X") + +locally { + val fff = new java.util.Formattable { + def formatTo(f: java.util.Formatter, g: Int, w: Int, p: Int) = f.format("4") + } + println(f"She is ${fff}%#s feet tall.") +} { implicit val strToShort = (s: String) => java.lang.Short.parseShort(s) @@ -103,4 +111,11 @@ println(f"${c.getTime.getTime}%TD") implicit val strToDate = (x: String) => c println(f"""${"1234"}%TD""") + + +// literals and arg indexes +println(f"%%") +println(f"${7}%d %<d ${9}%d") +println(f"${7}%d %2$$d ${9}%d") + } |