summaryrefslogtreecommitdiff
path: root/jni/ruby/test/-ext-/string/test_qsort.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/-ext-/string/test_qsort.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/-ext-/string/test_qsort.rb')
-rw-r--r--jni/ruby/test/-ext-/string/test_qsort.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/jni/ruby/test/-ext-/string/test_qsort.rb b/jni/ruby/test/-ext-/string/test_qsort.rb
new file mode 100644
index 0000000..3a58523
--- /dev/null
+++ b/jni/ruby/test/-ext-/string/test_qsort.rb
@@ -0,0 +1,19 @@
+require 'test/unit'
+require "-test-/string/string"
+
+class Test_StringQSort < Test::Unit::TestCase
+ def test_qsort
+ s = Bug::String.new("xxozfxx")
+ s.qsort!
+ assert_equal("foxxxxz", s)
+ end
+
+ def test_qsort_slice
+ s = Bug::String.new("xxofzx1")
+ s.qsort!(nil, nil, 3)
+ assert_equal("fzxxxo1", s)
+ s = Bug::String.new("xxofzx231")
+ s.qsort!(nil, nil, 3)
+ assert_equal("231fzxxxo", s)
+ end
+end