summaryrefslogtreecommitdiff
path: root/test/-ext-/string/test_qsort.rb
blob: 1a6dae0124b1006df104290fda90edc6c6e69e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'test/unit'
require "-test-/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