summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-24 02:23:52 +0800
committerGitHub <noreply@github.com>2020-11-23 19:23:52 +0100
commit0c6c4be0e783893cc21352fa686fb18c158d3e43 (patch)
treed9b43a4aba45ae1f26b36c04be46204dc8c3a731 /tests
parent7fc0c3dfbf5e27805fa75745acabf5ce2f0af693 (diff)
downloadNim-0c6c4be0e783893cc21352fa686fb18c158d3e43.tar.gz
fix ropes format errors (#16106) [backport:1.0]
* fix rope index

* add testcase

* fix ropes format
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tropes.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/stdlib/tropes.nim b/tests/stdlib/tropes.nim
index 9678e26c3..0c95d5c5f 100644
--- a/tests/stdlib/tropes.nim
+++ b/tests/stdlib/tropes.nim
@@ -64,3 +64,10 @@ block:
     inc i
 
   doAssert r[66] == '\0'
+
+block:
+  let r1 = "$1 $2 $3" % [rope("Nim"), rope("is"), rope("a great language")]
+  doAssert $r1 == "Nim is a great language"
+
+  let r2 = "$# $# $#" % [rope("Nim"), rope("is"), rope("a great language")]
+  doAssert $r2 == "Nim is a great language"