summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--bootstraptest/test_io.rb9
-rw-r--r--bootstraptest/test_knownbug.rb47
-rw-r--r--bootstraptest/test_marshal.rb5
-rw-r--r--bootstraptest/test_objectspace.rb20
-rw-r--r--test/ruby/test_integer.rb2
-rw-r--r--test/ruby/test_regexp.rb9
7 files changed, 55 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 29bf4ed4ef..99fe6ca83f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Nov 23 17:26:11 2007 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/test_knownbug.rb: move solved tests.
+
+ * bootstraptest/test_io.rb, test_marshal.rb, test_objectspace.rb:
+ ditto.
+
+ * test/ruby/test_integer.rb, test_regexp.rb: ditto.
+
Fri Nov 23 15:59:04 2007 Tanaka Akira <akr@fsij.org>
* struct.c (rb_struct_alloc_noinit): new function.
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
new file mode 100644
index 0000000000..8cd2730c6a
--- /dev/null
+++ b/bootstraptest/test_io.rb
@@ -0,0 +1,9 @@
+assert_finish 1, %q{
+ r, w = IO.pipe
+ t1 = Thread.new { r.sysread(1) }
+ t2 = Thread.new { r.sysread(1) }
+ sleep 0.1
+ w.write "a"
+ sleep 0.1
+ w.write "a"
+}, '[ruby-dev:31866]'
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb
index 99df941737..0fc902b552 100644
--- a/bootstraptest/test_knownbug.rb
+++ b/bootstraptest/test_knownbug.rb
@@ -3,49 +3,11 @@
# So all tests will cause failure.
#
-assert_finish 1, %q{
- r, w = IO.pipe
- t1 = Thread.new { r.sysread(1) }
- t2 = Thread.new { r.sysread(1) }
- sleep 0.1
- w.write "a"
- sleep 0.1
- w.write "a"
-}, '[ruby-dev:31866]'
-
-assert_normal_exit %q{
- Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
-}
-
assert_not_match /method_missing/, %q{
STDERR.reopen(STDOUT)
variable_or_mehtod_not_exist
}
-assert_normal_exit %q{
- ary = (1..10).to_a
- ary.permutation(2) {|x|
- if x == [1,2]
- ObjectSpace.each_object(String) {|s|
- s.clear if s.length == 40 || s.length == 80
- }
- end
- }
-}, '[ruby-dev:31982]'
-
-assert_normal_exit %q{
- ary = (1..100).to_a
- ary.permutation(2) {|x|
- if x == [1,2]
- ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
- end
- }
-}, '[ruby-dev:31985]'
-
-assert_normal_exit %q{
- Regexp.union("a", "a")
-}
-
assert_equal 'ok', %q{
begin
Regexp.union(
@@ -58,14 +20,6 @@ assert_equal 'ok', %q{
end
}
-assert_equal 'ok', %q{
- 0**-1 == 0 ? :ng : :ok
-}
-
-assert_equal '(?-mix:\000)', %q{
- Regexp.new("\0")
-}
-
assert_normal_exit %q{
STDERR.reopen(STDOUT)
require 'yaml'
@@ -85,3 +39,4 @@ assert_equal 'ok', %q{
C.new.to_enum.each {|*v| vs2 << v }
vs1 == vs2 ? :ok : :ng
}, '[ruby-dev:32329]'
+
diff --git a/bootstraptest/test_marshal.rb b/bootstraptest/test_marshal.rb
new file mode 100644
index 0000000000..ef406bba1c
--- /dev/null
+++ b/bootstraptest/test_marshal.rb
@@ -0,0 +1,5 @@
+
+assert_normal_exit %q{
+ Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
+}
+
diff --git a/bootstraptest/test_objectspace.rb b/bootstraptest/test_objectspace.rb
index f138ac5f6c..4f93341f72 100644
--- a/bootstraptest/test_objectspace.rb
+++ b/bootstraptest/test_objectspace.rb
@@ -11,3 +11,23 @@ assert_normal_exit %q{
o.inspect if defined?(o.inspect)
}
}, '[ruby-dev:31911]'
+
+assert_normal_exit %q{
+ ary = (1..10).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(String) {|s|
+ s.clear if s.length == 40 || s.length == 80
+ }
+ end
+ }
+}, '[ruby-dev:31982]'
+
+assert_normal_exit %q{
+ ary = (1..100).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
+ end
+ }
+}, '[ruby-dev:31985]'
diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb
index 37f83a0acd..4771f8b790 100644
--- a/test/ruby/test_integer.rb
+++ b/test/ruby/test_integer.rb
@@ -241,6 +241,8 @@ class TestInteger < Test::Unit::TestCase
end
}
}
+
+ assert_equal(0**-1 == 0, false)
end
def test_not
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 24ac731d8e..2b10620d6c 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -28,4 +28,13 @@ class TestRegexp < Test::Unit::TestCase
def test_ruby_dev_31309
assert_equal('Ruby', 'Ruby'.sub(/[^a-z]/i, '-'))
end
+
+ def test_assert_normal_exit
+ # moved from knownbug. It caused core.
+ Regexp.union("a", "a")
+ end
+
+ def test_to_s
+ assert_equal '(?-mix:\000)', Regexp.new("\0").to_s
+ end
end