~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to test/ruby/test_dir.rb

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
  def setup
11
11
    Dir.mkdir(ROOT)
12
12
    for i in ?a..?z
13
 
      if i % 2 == 0
14
 
        FileUtils.touch(File.join(ROOT, i.chr))
 
13
      if i.ord % 2 == 0
 
14
        FileUtils.touch(File.join(ROOT, i))
15
15
      else
16
 
        FileUtils.mkdir(File.join(ROOT, i.chr))
 
16
        FileUtils.mkdir(File.join(ROOT, i))
17
17
      end
18
18
    end
19
19
  end
31
31
        break unless name = dir.read
32
32
        cache << [pos, name]
33
33
      end
34
 
      for x,y in cache.sort_by {|x| x[0] % 3 } # shuffle
 
34
      for x,y in cache.sort_by {|z| z[0] % 3 } # shuffle
35
35
        dir.seek(x)
36
36
        assert_equal(y, dir.read)
37
37
      end