summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tstring.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/stdlib/tstring.nim b/tests/stdlib/tstring.nim
index 0a7bf0511..ff3d41b49 100644
--- a/tests/stdlib/tstring.nim
+++ b/tests/stdlib/tstring.nim
@@ -91,3 +91,10 @@ proc tester[T](x: T) =
 
 tester(1)
 
+# #14497 
+func reverse*(a: string): string =
+  result = a
+  for i in 0 ..< a.len div 2:
+    swap(result[i], result[^(i + 1)])
+
+doAssert reverse("hello") == "olleh"