diff options
Diffstat (limited to 'tests/stdlib/tstrformatMissingFormatValue.nim')
-rw-r--r-- | tests/stdlib/tstrformatMissingFormatValue.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stdlib/tstrformatMissingFormatValue.nim b/tests/stdlib/tstrformatMissingFormatValue.nim new file mode 100644 index 000000000..66c1c8772 --- /dev/null +++ b/tests/stdlib/tstrformatMissingFormatValue.nim @@ -0,0 +1,16 @@ +discard """ +errormsg: '''type mismatch: got <string, Obj, string>''' +nimout: '''proc formatValue''' +""" + +# This test is here to make sure that there is a clean error that +# that indicates ``formatValue`` needs to be overloaded with the custom type. + +import strformat + +type Obj = object + +proc `$`(o: Obj): string = "foobar" + +var o: Obj +doAssert fmt"{o}" == "foobar" |