summaryrefslogtreecommitdiff
path: root/test/-ext-/string/test_qsort.rb
blob: 94aff8c3c45ea44b21434e7909a1cf6e4f586a30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: false
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