opal 1.8.0.alpha1 → 1.8.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.eslintrc.js +1 -0
- data/README.md +7 -7
- data/UNRELEASED.md +14 -0
- data/docs/releasing.md +8 -16
- data/lib/opal/cli_runners/chrome.rb +5 -1
- data/lib/opal/nodes/closure.rb +15 -7
- data/lib/opal/nodes/defined.rb +1 -1
- data/lib/opal/nodes/literal.rb +10 -6
- data/lib/opal/nodes/rescue.rb +1 -1
- data/lib/opal/simple_server.rb +2 -2
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/array.rb +39 -21
- data/opal/corelib/class.rb +26 -8
- data/opal/corelib/complex.rb +1 -1
- data/opal/corelib/constants.rb +2 -2
- data/opal/corelib/enumerator/arithmetic_sequence.rb +1 -1
- data/opal/corelib/error.rb +10 -0
- data/opal/corelib/hash.rb +30 -18
- data/opal/corelib/kernel.rb +0 -1
- data/opal/corelib/module.rb +44 -5
- data/opal/corelib/number.rb +28 -1
- data/opal/corelib/range.rb +1 -1
- data/opal/corelib/rational.rb +1 -1
- data/opal/corelib/runtime.js +124 -42
- data/opal/corelib/string.rb +36 -8
- data/opal/corelib/struct.rb +1 -1
- data/opal/corelib/time.rb +1 -1
- data/spec/filters/bugs/array.rb +58 -0
- data/spec/filters/bugs/basicobject.rb +7 -0
- data/spec/filters/bugs/bigdecimal.rb +1 -2
- data/spec/filters/bugs/binding.rb +1 -0
- data/spec/filters/bugs/class.rb +2 -3
- data/spec/filters/bugs/complex.rb +3 -0
- data/spec/filters/bugs/date.rb +5 -2
- data/spec/filters/bugs/datetime.rb +1 -0
- data/spec/filters/bugs/delegate.rb +1 -2
- data/spec/filters/bugs/encoding.rb +1 -1
- data/spec/filters/bugs/enumerable.rb +11 -0
- data/spec/filters/bugs/enumerator.rb +15 -2
- data/spec/filters/bugs/exception.rb +9 -4
- data/spec/filters/bugs/file.rb +2 -0
- data/spec/filters/bugs/float.rb +1 -0
- data/spec/filters/bugs/freeze.rb +5 -49
- data/spec/filters/bugs/hash.rb +1 -0
- data/spec/filters/bugs/integer.rb +5 -6
- data/spec/filters/bugs/kernel.rb +12 -5
- data/spec/filters/bugs/language.rb +33 -15
- data/spec/filters/bugs/marshal.rb +63 -4
- data/spec/filters/bugs/method.rb +2 -10
- data/spec/filters/bugs/module.rb +18 -7
- data/spec/filters/bugs/objectspace.rb +2 -0
- data/spec/filters/bugs/pathname.rb +1 -0
- data/spec/filters/bugs/proc.rb +4 -2
- data/spec/filters/bugs/random.rb +0 -3
- data/spec/filters/bugs/range.rb +1 -1
- data/spec/filters/bugs/rational.rb +2 -0
- data/spec/filters/bugs/refinement.rb +19 -0
- data/spec/filters/bugs/regexp.rb +27 -5
- data/spec/filters/bugs/ruby-32.rb +0 -4
- data/spec/filters/bugs/set.rb +10 -2
- data/spec/filters/bugs/singleton.rb +0 -2
- data/spec/filters/bugs/string.rb +140 -1
- data/spec/filters/bugs/struct.rb +15 -5
- data/spec/filters/bugs/time.rb +56 -2
- data/spec/filters/bugs/trace_point.rb +1 -0
- data/spec/filters/bugs/unboundmethod.rb +4 -9
- data/spec/filters/bugs/warnings.rb +0 -1
- data/spec/filters/platform/firefox/exception.rb +3 -3
- data/spec/filters/platform/firefox/kernel.rb +1 -0
- data/spec/filters/platform/safari/exception.rb +2 -2
- data/spec/filters/platform/safari/float.rb +1 -0
- data/spec/filters/platform/safari/kernel.rb +1 -0
- data/spec/filters/platform/safari/literal_regexp.rb +2 -2
- data/spec/filters/unsupported/hash.rb +1 -1
- data/spec/lib/compiler_spec.rb +4 -0
- data/spec/opal/core/class/clone_spec.rb +36 -0
- data/spec/opal/core/object_id_spec.rb +0 -6
- data/spec/opal/language/predefined_spec.rb +20 -0
- data/spec/opal/language/yield_spec.rb +43 -0
- data/spec/ruby_specs +0 -2
- data/stdlib/bigdecimal.rb +2 -0
- data/stdlib/delegate.rb +3 -4
- data/stdlib/pathname.rb +1 -1
- data/stdlib/promise/v2.rb +22 -7
- data/stdlib/stringio.rb +2 -0
- data/tasks/testing.rake +15 -11
- data/test/opal/promisev2/test_always.rb +14 -0
- data/test/opal/unsupported_and_bugs.rb +0 -8
- metadata +10 -6
@@ -2,7 +2,10 @@
|
|
2
2
|
opal_filter "Complex" do
|
3
3
|
fails "Complex#<=> returns 0, 1, or -1 if self and argument do not have imaginary part" # Expected nil == 1 to be truthy but was false
|
4
4
|
fails "Complex#coerce returns an array containing other as Complex and self when other is a Numeric which responds to #real? with true" # Expected (#<NumericMockObject:0x1574c @name="other" @null=nil>+0i) to have same value and type as (#<NumericMockObject:0x1574c @name="other" @null=nil>+0i)
|
5
|
+
fails "Complex#inspect adds an `*' before the `i' if the last character of the imaginary part is not numeric" # ArgumentError: comparison of NumericSpecs::Subclass with 0 failed
|
6
|
+
fails "Complex#inspect calls #inspect on real and imaginary" # ArgumentError: comparison of NumericSpecs::Subclass with 0 failed
|
5
7
|
fails "Complex#to_c returns self" # Expected ((1+5i)+0i) to be identical to (1+5i)
|
6
8
|
fails "Complex#to_c returns the same value" # Expected ((1+5i)+0i) == (1+5i) to be truthy but was false
|
9
|
+
fails "Complex#to_s treats real and imaginary parts as strings" # ArgumentError: comparison of NumericSpecs::Subclass with 0 failed
|
7
10
|
fails "Complex.polar computes the real values of the real & imaginary parts from the polar form" # TypeError: not a real
|
8
11
|
end
|
data/spec/filters/bugs/date.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Date" do
|
3
|
+
fails "Date constants defines MONTHNAMES" # Expected [nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Unknown"] == [nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] to be truthy but was false
|
4
|
+
fails "Date constants freezes MONTHNAMES, DAYNAMES, ABBR_MONTHNAMES, ABBR_DAYSNAMES" # Expected FrozenError (/frozen/) but no exception was raised ([nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Unknown"] was returned)
|
3
5
|
fails "Date#>> returns the day of the reform if date falls within calendar reform" # Expected #<Date:0x28ea @date=1582-10-09 00:00:00 +0124, @start=2299161> == #<Date:0x28e6 @date=1582-10-04 00:00:00 +0124, @start=2299161> to be truthy but was false
|
4
6
|
fails "Date#ajd determines the Astronomical Julian day" # NoMethodError: undefined method `ajd' for #<Date:0x9f5b0 @date=2007-01-17 00:00:00 +0100 @start=2299161>
|
5
7
|
fails "Date#amjd determines the Astronomical Modified Julian day" # NoMethodError: undefined method `amjd' for #<Date:0x9f5ba @date=2007-01-17 00:00:00 +0100 @start=2299161>
|
6
|
-
fails "Date#civil creates a Date for different calendar reform dates" # Expected 5 == 15 to be truthy but was false
|
7
|
-
fails "Date#civil doesn't create dates for invalid arguments" # Expected ArgumentError but no exception was raised (#<Date:0x73d98 @date=2001-01-31 00:00:00 +0100, @start=2299161> was returned)
|
8
8
|
fails "Date#commercial creates a Date for Julian Day Number day 0 by default" # NoMethodError: undefined method `commercial' for Date
|
9
9
|
fails "Date#commercial creates a Date for the correct day given the year, week and day number" # NoMethodError: undefined method `commercial' for Date
|
10
10
|
fails "Date#commercial creates a Date for the monday in the year and week given" # NoMethodError: undefined method `commercial' for Date
|
@@ -31,6 +31,7 @@ opal_filter "Date" do
|
|
31
31
|
fails "Date#strftime should be able to print the commercial year with only two digits" # TypeError: no implicit conversion of Range into Integer
|
32
32
|
fails "Date#strftime should be able to show a full notation" # Expected "%+" == "Sun Apr 9 00:00:00 +00:00 2000" to be truthy but was false
|
33
33
|
fails "Date#strftime should be able to show the commercial week day" # Expected "1" == "7" to be truthy but was false
|
34
|
+
fails "Date#strftime should be able to show the commercial week" # Expected " 9-APR-2000" == " 9-Apr-2000" to be truthy but was false
|
34
35
|
fails "Date#strftime should be able to show the number of seconds since the unix epoch for a date" # Expected "954972000" == "954979200" to be truthy but was false
|
35
36
|
fails "Date#strftime should be able to show the timezone of the date with a : separator" # Expected "+0200" == "+0000" to be truthy but was false
|
36
37
|
fails "Date#strftime should be able to show the timezone with a : separator" # Expected "Central European Summer Time" == "+00:00" to be truthy but was false
|
@@ -72,6 +73,8 @@ opal_filter "Date" do
|
|
72
73
|
fails "Date#valid_date? returns true if it is a valid civil date" # NoMethodError: undefined method `valid_date?' for Date
|
73
74
|
fails "Date._iso8601 returns an empty hash if the argument is a invalid Date" # NoMethodError: undefined method `_iso8601' for Date
|
74
75
|
fails "Date._rfc3339 returns an empty hash if the argument is a invalid Date" # NoMethodError: undefined method `_rfc3339' for Date
|
76
|
+
fails "Date.civil creates a Date for different calendar reform dates" # Expected 5 == 15 to be truthy but was false
|
77
|
+
fails "Date.civil doesn't create dates for invalid arguments" # Expected ArgumentError but no exception was raised (#<Date:0x9c330 @date=2001-01-31 00:00:00 +0100, @start=2299161> was returned)
|
75
78
|
fails "Date.iso8601 parses YYYY-MM-DD into a Date object" # NoMethodError: undefined method `iso8601' for Date
|
76
79
|
fails "Date.iso8601 parses YYYYMMDD into a Date object" # NoMethodError: undefined method `iso8601' for Date
|
77
80
|
fails "Date.iso8601 parses a StringSubclass into a Date object" # NoMethodError: undefined method `iso8601' for Date
|
@@ -16,6 +16,7 @@ opal_filter "DateTime" do
|
|
16
16
|
fails "DateTime#strftime should be able to show a full notation" # Expected "%+" == "Sat Feb 3 04:05:06 +00:00 2001" to be truthy but was false
|
17
17
|
fails "DateTime#strftime should be able to show default Logger format" # Expected "2001-12-03T04:05:06.000000 " == "2001-12-03T04:05:06.100000 " to be truthy but was false
|
18
18
|
fails "DateTime#strftime should be able to show the commercial week day" # Expected "1" == "7" to be truthy but was false
|
19
|
+
fails "DateTime#strftime should be able to show the commercial week" # Expected " 3-FEB-2001" == " 3-Feb-2001" to be truthy but was false
|
19
20
|
fails "DateTime#strftime should be able to show the number of seconds since the unix epoch" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String
|
20
21
|
fails "DateTime#strftime should be able to show the timezone of the date with a : separator" # Expected "-0000" == "+0000" to be truthy but was false
|
21
22
|
fails "DateTime#strftime should be able to show the timezone with a : separator" # Expected "UTC" == "+00:00" to be truthy but was false
|
@@ -3,7 +3,6 @@ opal_filter "Delegate" do
|
|
3
3
|
fails "Delegator#!= is delegated in general" # Exception: Maximum call stack size exceeded
|
4
4
|
fails "Delegator#== is delegated in general" # Exception: Maximum call stack size exceeded
|
5
5
|
fails "Delegator#method raises a NameError if method is no longer valid because object has changed" # Expected NameError but no exception was raised ("foo" was returned)
|
6
|
+
fails "Delegator#method returns a method object for public methods of the delegate object" # NameError: undefined method `pub' for class `DelegateSpecs::Delegator'
|
6
7
|
fails "Delegator#method returns a method that respond_to_missing?" # NameError: undefined method `pub_too' for class `DelegateSpecs::Simple'
|
7
|
-
fails "Delegator#methods includes instance methods of the Delegator class" # Expected ["singleton_method", "pub", "respond_to_missing?", "method_missing", "priv", "prot", "to_json", "guard", "guard_not", "with_feature", "without_feature", "new_fd", "new_io", "should", "should_not", "version_is", "ruby_version_is", "kernel_version_is", "suppress_warning", "suppress_keyword_warning", "should_receive", "should_not_receive", "stub!", "mock", "mock_int", "mock_numeric", "evaluate", "before", "after", "describe", "it", "it_should_behave_like", "context", "specify", "it_behaves_like", "ruby_bug", "conflicts_with", "big_endian", "little_endian", "platform_is", "platform_is_not", "quarantine!", "not_supported_on", "as_superuser", "as_real_superuser", "as_user", "argf", "argv", "new_datetime", "with_timezone", "fixture", "flunk", "cp", "mkdir_p", "rm_r", "touch", "mock_to_path", "nan_value", "infinity_value", "bignum_value", "max_long", "min_long", "fixnum_max", "fixnum_min", "ruby_exe_options", "resolve_ruby_exe", "ruby_exe", "ruby_cmd", "opal_filter", "opal_unsupported_filter", "frozen_error_class", "pack_format", "DelegateClass", "module_specs_public_method_on_object", "module_specs_private_method_on_object", "module_specs_protected_method_on_object", "module_specs_private_method_on_object_for_kernel_public", "module_specs_public_method_on_object_for_kernel_protected", "module_specs_public_method_on_object_for_kernel_private", "unpack_format", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "shellsplit", "shellwords", "shellescape", "shelljoin", "expect", "eq", "pretty_print", "pretty_print_cycle", "pretty_print_instance_variables", "pretty_print_inspect", "=~", "!~", "===", "<=>", "method", "methods", "public_methods", "Array", "at_exit", "caller", "caller_locations", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "initialize_clone", "define_singleton_method", "dup", "initialize_dup", "enum_for", "equal?", "exit", "extend", "freeze", "frozen?", "gets", "hash", "initialize_copy", "inspect", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "remove_instance_variable", "instance_variables", "Integer", "Float", "Hash", "is_a?", "itself", "lambda", "load", "loop", "nil?", "printf", "proc", "puts", "p", "print", "readline", "warn", "raise", "rand", "respond_to?", "require", "require_relative", "require_tree", "singleton_class", "sleep", "srand", "String", "tap", "to_proc", "to_s", "catch", "throw", "open", "yield_self", "fail", "kind_of?", "object_id", "public_send", "send", "then", "to_enum", "format", "sprintf", "Complex", "Rational", "taint", "untaint", "tainted?", "private_methods", "protected_methods", "private_instance_methods", "protected_instance_methods", "eval", "binding", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "BigDecimal", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel", "__send__", "__id__", "==", "!", "initialize", "eql?", "!=", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined", "__marshal__"] to include "extra"
|
8
|
-
fails "Delegator#tap yield the delegator object" # Expected 0 == 1 to be truthy but was false
|
9
8
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Encoding" do
|
3
3
|
fails "File.basename returns the basename with the same encoding as the original" # NameError: uninitialized constant Encoding::Windows_1250
|
4
|
+
fails "Hash literal does not change encoding of literal string keys during creation" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
|
4
5
|
fails "Integer#to_s bignum returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
|
5
6
|
fails "Integer#to_s bignum returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
|
6
7
|
fails "Integer#to_s bignum when given a base raises an ArgumentError if the base is less than 2 or higher than 36" # NoMethodError: undefined method `default_internal' for Encoding
|
@@ -36,7 +37,6 @@ opal_filter "Encoding" do
|
|
36
37
|
fails "Source files encoded in UTF-16 BE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
37
38
|
fails "Source files encoded in UTF-16 BE without a BOM are parsed as empty because they contain a NUL byte before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
38
39
|
fails "Source files encoded in UTF-16 LE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
39
|
-
fails "Source files encoded in UTF-16 LE without a BOM are parsed because empty as they contain a NUL byte before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
40
40
|
fails "Source files encoded in UTF-8 with a BOM can be parsed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
41
41
|
fails "Source files encoded in UTF-8 without a BOM can be parsed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x49e4c>
|
42
42
|
fails "String#% output's encoding negotiates a compatible encoding if necessary" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
|
@@ -1,7 +1,10 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Enumerable" do
|
3
|
+
fails "Enumerable#all? when given a pattern argument ignores the block if there is an argument" # Expected warning to match: /given block not used/ but got: ""
|
4
|
+
fails "Enumerable#any? when given a pattern argument ignores the block if there is an argument" # Expected warning to match: /given block not used/ but got: ""
|
3
5
|
fails "Enumerable#chain returns a chain of self and provided enumerables" # NoMethodError: undefined method `chain' for #<EnumerableSpecs::Numerous:0x2eb8 @list=[1]>
|
4
6
|
fails "Enumerable#chain returns an Enumerator::Chain if given a block" # NoMethodError: undefined method `chain' for #<EnumerableSpecs::Numerous:0x2eb2 @list=[2, 5, 3, 6, 1, 4]>
|
7
|
+
fails "Enumerable#chunk returns a partitioned Array of values" # NoMethodError: undefined method `last' for false
|
5
8
|
fails "Enumerable#chunk_while on a single-element array ignores the block and returns an enumerator that yields [element]" # Expected [] == [[1]] to be truthy but was false
|
6
9
|
fails "Enumerable#collect reports the same arity as the given block" # Exception: Cannot read properties of undefined (reading '$$is_array')
|
7
10
|
fails "Enumerable#collect yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments (given 1, expected 2)
|
@@ -12,10 +15,16 @@ opal_filter "Enumerable" do
|
|
12
15
|
fails "Enumerable#grep_v correctly handles non-string elements" # Expected nil == "match" to be truthy but was false
|
13
16
|
fails "Enumerable#grep_v does not modify Regexp.last_match without block" # Expected "e" == "z" to be truthy but was false
|
14
17
|
fails "Enumerable#grep_v does not set $~ when given no block" # Expected "e" == "z" to be truthy but was false
|
18
|
+
fails "Enumerable#inject ignores the block if two arguments" # Expected warning to match: /ruby\/core\/enumerable\/shared\/inject.rb:23: warning: given block not used/ but got: ""
|
15
19
|
fails "Enumerable#inject raises an ArgumentError when no parameters or block is given" # Expected ArgumentError but got: Exception (Cannot read properties of undefined (reading '$inspect'))
|
20
|
+
fails "Enumerable#inject tolerates increasing a collection size during iterating Array" # Expected ["a", "b", "c"] == [0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 7, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 8, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, "a", "b", "c"] to be truthy but was false
|
16
21
|
fails "Enumerable#map reports the same arity as the given block" # Exception: Cannot read properties of undefined (reading '$$is_array')
|
17
22
|
fails "Enumerable#map yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments (given 1, expected 2)
|
23
|
+
fails "Enumerable#none? when given a pattern argument ignores the block if there is an argument" # Expected warning to match: /given block not used/ but got: ""
|
24
|
+
fails "Enumerable#one? when given a pattern argument ignores the block if there is an argument" # Expected warning to match: /given block not used/ but got: ""
|
25
|
+
fails "Enumerable#reduce ignores the block if two arguments" # Expected warning to match: /ruby\/core\/enumerable\/shared\/inject.rb:23: warning: given block not used/ but got: ""
|
18
26
|
fails "Enumerable#reduce raises an ArgumentError when no parameters or block is given" # Expected ArgumentError but got: Exception (Cannot read properties of undefined (reading '$inspect'))
|
27
|
+
fails "Enumerable#reduce tolerates increasing a collection size during iterating Array" # Expected ["a", "b", "c"] == [0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 7, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 8, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, "a", "b", "c"] to be truthy but was false
|
19
28
|
fails "Enumerable#reverse_each gathers whole arrays as elements when each yields multiple" # Expected [6, 3, 1] == [[6, 7, 8, 9], [3, 4, 5], [1, 2]] to be truthy but was false
|
20
29
|
fails "Enumerable#slice_when when an iterator method yields more than one value processes all yielded values" # Expected [] == [[[1, 2]]] to be truthy but was false
|
21
30
|
fails "Enumerable#slice_when when given a block doesn't yield an empty array on a small enumerable" # Expected [] == [[42]] to be truthy but was false
|
@@ -23,6 +32,8 @@ opal_filter "Enumerable" do
|
|
23
32
|
fails "Enumerable#sort_by returns an array of elements when a block is supplied and #map returns an enumerable" # NoMethodError: undefined method `sort!' for #<EnumerableSpecs::MapReturnsEnumerable::EnumerableMapping:0x42a48 @items=#<EnumerableSpecs::MapReturnsEnumerable:0x42a46> @block=#<Proc:0x42a4a>>
|
24
33
|
fails "Enumerable#take_while calls the block with initial args when yielded with multiple arguments" # Expected [1, [2], [3, 4], [5, 6, 7], [8, 9], nil, []] == [1, [2], 3, 5, [8, 9], nil, []] to be truthy but was false
|
25
34
|
fails "Enumerable#tally counts values as gathered array when yielded with multiple arguments" # Expected {[]=>3, 0=>1, [0, 1]=>2, [0, 1, 2]=>3, nil=>1, "default_arg"=>1, [0]=>1} == {nil=>2, 0=>1, [0, 1]=>2, [0, 1, 2]=>3, "default_arg"=>1, []=>2, [0]=>1} to be truthy but was false
|
35
|
+
fails "Enumerable#tally with a hash calls #to_hash to convert argument to Hash implicitly if passed not a Hash" # NoMethodError: undefined method `fetch' for #<Object:0x8def0>
|
26
36
|
fails "Enumerable#uniq uses eql? semantics" # Expected [1] == [1, 1] to be truthy but was false
|
27
37
|
fails "Enumerable#zip passes each element of the result array to a block and return nil if a block is given" # Expected [[1, 4, 7], [2, 5, 8], [3, 6, 9]] == nil to be truthy but was false
|
38
|
+
fails "Enumerable#zip raises TypeError when some argument isn't Array and doesn't respond to #to_ary and #to_enum" # Expected TypeError (wrong argument type Object (must respond to :each)) but got: NoMethodError (undefined method `each' for #<Object:0x2e1e6>)
|
28
39
|
end
|
@@ -12,15 +12,28 @@ opal_filter "Enumerator" do
|
|
12
12
|
fails "Enumerator#initialize sets size to the given size if the given size is Float::INFINITY" # Expected 4 to be identical to Infinity
|
13
13
|
fails "Enumerator#initialize sets size to the given size if the given size is a Proc" # NoMethodError: undefined method `size' for nil
|
14
14
|
fails "Enumerator#initialize sets size to the given size if the given size is an Integer" # Expected 4 == 100 to be truthy but was false
|
15
|
+
fails "Enumerator#inspect returns a not initialized representation if #initialized is not called yet" # NoMethodError: undefined method `any?' for nil
|
15
16
|
fails "Enumerator.new no block given raises" # Expected ArgumentError but no exception was raised (#<Enumerator: 1:upto(3)> was returned)
|
16
17
|
fails "Enumerator.new when passed a block yielded values handles yield arguments properly" # Expected 1 == [1, 2] to be truthy but was false
|
17
18
|
fails "Enumerator.produce creates an infinite enumerator" # NoMethodError: undefined method `produce' for Enumerator
|
18
19
|
fails "Enumerator.produce terminates iteration when block raises StopIteration exception" # NoMethodError: undefined method `produce' for Enumerator
|
19
20
|
fails "Enumerator.produce when initial value skipped starts enumerable from result of first block call" # NoMethodError: undefined method `produce' for Enumerator
|
20
21
|
fails "Enumerator.produce when initial value skipped uses nil instead" # NoMethodError: undefined method `produce' for Enumerator
|
21
|
-
fails "Enumerator
|
22
|
+
fails "Enumerator.product accepts a block" # NoMethodError: undefined method `product' for Enumerator
|
23
|
+
fails "Enumerator.product accepts a list of enumerators of any length" # NoMethodError: undefined method `product' for Enumerator
|
24
|
+
fails "Enumerator.product accepts infinite enumerators and returns infinite enumerator" # NoMethodError: undefined method `product' for Enumerator
|
25
|
+
fails "Enumerator.product calls #each_entry lazily" # NoMethodError: undefined method `product' for Enumerator
|
26
|
+
fails "Enumerator.product calls only #each_entry method on arguments" # NoMethodError: undefined method `product' for Enumerator
|
27
|
+
fails "Enumerator.product iterates through consuming enumerator elements only once" # NoMethodError: undefined method `product' for Enumerator
|
28
|
+
fails "Enumerator.product raises NoMethodError when argument doesn't respond to #each_entry" # Expected NoMethodError (/undefined method `each_entry' for/) but got: NoMethodError (undefined method `product' for Enumerator)
|
29
|
+
fails "Enumerator.product reject keyword arguments" # Expected ArgumentError (unknown keywords: :foo, :bar) but got: NoMethodError (undefined method `product' for Enumerator)
|
30
|
+
fails "Enumerator.product returns a Cartesian product of enumerators" # NoMethodError: undefined method `product' for Enumerator
|
31
|
+
fails "Enumerator.product returns an enumerator with an empty array when no arguments passed" # NoMethodError: undefined method `product' for Enumerator
|
32
|
+
fails "Enumerator.product returns an instance of Enumerator::Product" # NoMethodError: undefined method `product' for Enumerator
|
33
|
+
fails "Enumerator.product returns nil when a block passed" # NoMethodError: undefined method `product' for Enumerator
|
22
34
|
fails "Enumerator::ArithmeticSequence.allocate is not defined" # Expected TypeError (allocator undefined for Enumerator::ArithmeticSequence) but no exception was raised (#<Enumerator::ArithmeticSequence>(#pretty_inspect raised #<NoMethodError: undefined method `begin' for nil>) was returned)
|
23
35
|
fails "Enumerator::ArithmeticSequence.new is not defined" # Expected NoMethodError but got: ArgumentError ([ArithmeticSequence#initialize] wrong number of arguments (given 0, expected -2))
|
36
|
+
fails "Enumerator::Chain#inspect returns a not initialized representation if #initialized is not called yet" # Expected "#<Enumerator::Chain: nil>" == "#<Enumerator::Chain: uninitialized>" to be truthy but was false
|
24
37
|
fails "Enumerator::Generator#each returns the block returned value" # Expected #<Enumerator::Generator:0x3f346 @block=#<Proc:0x3f40c>> to be identical to "block_returned"
|
25
38
|
fails "Enumerator::Generator#initialize returns self when given a block" # Expected #<Proc:0x3ff5e> to be identical to #<Enumerator::Generator:0x3ff52 @block=#<Proc:0x3ff5e>>
|
26
39
|
fails "Enumerator::Lazy defines lazy versions of a whitelist of Enumerator methods" # Expected ["initialize", "lazy", "collect", "collect_concat", "drop", "drop_while", "enum_for", "find_all", "grep", "reject", "take", "take_while", "inspect", "force", "filter", "flat_map", "map", "select", "to_enum"] to include "chunk"
|
@@ -41,6 +54,7 @@ opal_filter "Enumerator" do
|
|
41
54
|
fails "Enumerator::Lazy#collect_concat when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float
|
42
55
|
fails "Enumerator::Lazy#collect_concat works with an infinite enumerable" # TypeError: can't iterate from Float
|
43
56
|
fails "Enumerator::Lazy#compact returns array without nil elements" # Expected [1, 3, false, 5] (Array) to be an instance of Enumerator::Lazy
|
57
|
+
fails "Enumerator::Lazy#compact sets #size to nil" # NoMethodError: undefined method `each' for #<Object:0x9caea>
|
44
58
|
fails "Enumerator::Lazy#drop on a nested Lazy sets difference of given count with old size to new size" # Expected 20 == 30 to be truthy but was false
|
45
59
|
fails "Enumerator::Lazy#drop on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float
|
46
60
|
fails "Enumerator::Lazy#drop sets difference of given count with old size to new size" # Expected 20 == 80 to be truthy but was false
|
@@ -150,6 +164,5 @@ opal_filter "Enumerator" do
|
|
150
164
|
fails "Enumerator::Lazy#zip when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float
|
151
165
|
fails "Enumerator::Lazy#zip works with an infinite enumerable and an array" # TypeError: can't iterate from Float
|
152
166
|
fails "Enumerator::Lazy#zip works with two infinite enumerables" # TypeError: can't iterate from Float
|
153
|
-
fails "SimpleDelegator can be marshalled with its instance variables intact" # Exception: Cannot create property 'foo' on string 'hello'
|
154
167
|
fails "SimpleDelegator can be marshalled" # Expected String == SimpleDelegator to be truthy but was false
|
155
168
|
end
|
@@ -26,9 +26,17 @@ opal_filter "Exception" do
|
|
26
26
|
fails "Exception#backtrace_locations returns nil if no backtrace was set" # Expected ["ruby/core/exception/backtrace_locations_spec.rb:10:14:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/context.rb:176:39:in `$$17'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "<internal:corelib/enumerable.rb>:27:16:in `$$3'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "<internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `all?'", "mspec/runner/context.rb:176:18:in `protect'", "mspec/runner/context.rb:212:26:in `$$21'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "mspec/runner/mspec.rb:284:7:in `repeat'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `repeat'", "mspec/runner/context.rb:204:16:in `$$20'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:203:18:in `process'", "mspec/runner/mspec.rb:55:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "mspec/runner/object.rb:11:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "ruby/core/exception/backtrace_locations_spec.rb:4:1:in `Opal.modules.ruby/core/exception/backtrace_locations_spec'", "<internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized'", "<internal:corelib/runtime.js>:2721:5:in `load'", "<internal:corelib/kernel.rb>:535:6:in `load'", "mspec/runner/mspec.rb:99:42:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/mspec.rb:99:7:in `$$1'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/mspec.rb:90:12:in `each_file'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each_file'", "mspec/runner/mspec.rb:95:5:in `files'", "mspec/runner/mspec.rb:63:5:in `process'", "tmp/mspec_nodejs.rb:3880:6:in `undefined'", "<internal:corelib/runtime.js>:2805:7:in `<main>'", "tmp/mspec_nodejs.rb:1:1:in `null'", "node:internal/modules/cjs/loader:1105:14:in `Module._compile'", "node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js'", "node:internal/modules/cjs/loader:981:32:in `Module.load'", "node:internal/modules/cjs/loader:822:12:in `Module._load'", "node:internal/modules/run_main:77:12:in `executeUserEntryPoint'", "node:internal/main/run_main_module:17:47:in `undefined'"] to be nil
|
27
27
|
fails "Exception#cause is set for internal errors caused by user errors" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
|
28
28
|
fails "Exception#cause is set for user errors caused by internal errors" # Expected RuntimeError but no exception was raised (Infinity was returned)
|
29
|
+
fails "Exception#detailed_message accepts highlight keyword argument and adds escape control sequences" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error>
|
30
|
+
fails "Exception#detailed_message allows and ignores other keyword arguments" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error>
|
31
|
+
fails "Exception#detailed_message returns 'unhandled exception' for an instance of RuntimeError with empty message" # NoMethodError: undefined method `detailed_message' for RuntimeError
|
32
|
+
fails "Exception#detailed_message returns a generated class name for an instance of RuntimeError anonymous subclass with empty message" # NoMethodError: undefined method `detailed_message' for #<Class:0x4b72c>
|
33
|
+
fails "Exception#detailed_message returns decorated message" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error>
|
34
|
+
fails "Exception#detailed_message returns just a message if exception class is anonymous" # NoMethodError: undefined method `detailed_message' for #<#<Class:0x4b742>: message>
|
35
|
+
fails "Exception#detailed_message returns just class name for an instance of RuntimeError sublass with empty message" # NoMethodError: undefined method `detailed_message' for DetailedMessageSpec::C
|
29
36
|
fails "Exception#exception captures an exception into $!" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /exception_spec/ to be truthy but was nil
|
30
|
-
fails "Exception#full_message contains all the chain of exceptions" # Expected "<internal:corelib/kernel.rb>:612:37:in `raise': \e[1mlast exception (\e[1;4mRuntimeError\e[m\e[1m)\e[m \tfrom ruby/core/exception/full_message_spec.rb:96:9:in `instance_exec' \tfrom <internal:corelib/basic_object.rb>:125:1:in `instance_exec' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `instance_exec' \tfrom mspec/runner/mspec.rb:116:11:in `protect' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `protect' \tfrom mspec/runner/context.rb:176:39:in `$$17' \tfrom <internal:corelib/runtime.js>:1667:5:in `Opal.yieldX' \tfrom <internal:corelib/enumerable.rb>:27:16:in `$$3' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom <internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `all?' \tfrom mspec/runner/context.rb:176:18:in `protect' \tfrom mspec/runner/context.rb:212:26:in `$$21' \tfrom <internal:corelib/runtime.js>:1667:5:in `Opal.yieldX' \tfrom mspec/runner/mspec.rb:284:7:in `repeat' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `repeat' \tfrom mspec/runner/context.rb:204:16:in `$$20' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom mspec/runner/context.rb:203:18:in `process' \tfrom mspec/runner/mspec.rb:55:10:in `describe' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `describe' \tfrom mspec/runner/object.rb:11:10:in `describe' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `describe' \tfrom ruby/core/exception/full_message_spec.rb:3:1:in `Opal.modules.ruby/core/exception/full_message_spec' \tfrom <internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized' \tfrom <internal:corelib/runtime.js>:2721:5:in `load' \tfrom <internal:corelib/kernel.rb>:535:6:in `load' \tfrom mspec/runner/mspec.rb:99:42:in `instance_exec' \tfrom <internal:corelib/basic_object.rb>:125:1:in `instance_exec' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `instance_exec' \tfrom mspec/runner/mspec.rb:116:11:in `protect' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `protect' \tfrom mspec/runner/mspec.rb:99:7:in `$$1' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom mspec/runner/mspec.rb:90:12:in `each_file' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each_file' \tfrom mspec/runner/mspec.rb:95:5:in `files' \tfrom mspec/runner/mspec.rb:63:5:in `process' \tfrom tmp/mspec_nodejs.rb:3880:6:in `undefined' \tfrom <internal:corelib/runtime.js>:2805:7:in `<main>' \tfrom tmp/mspec_nodejs.rb:1:1:in `null' \tfrom node:internal/modules/cjs/loader:1105:14:in `Module._compile' \tfrom node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js' \tfrom node:internal/modules/cjs/loader:981:32:in `Module.load' \tfrom node:internal/modules/cjs/loader:822:12:in `Module._load' \tfrom node:internal/modules/run_main:77:12:in `executeUserEntryPoint' \tfrom node:internal/main/run_main_module:17:47:in `undefined' <internal:corelib/kernel.rb>:612:37:in `raise': \e[1morigin exception (\e[1;4mRuntimeError\e[m\e[1m)\e[m \tfrom ruby/core/exception/full_message_spec.rb:91:11:in `instance_exec' \tfrom <internal:corelib/basic_object.rb>:125:1:in `instance_exec' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `instance_exec' \tfrom mspec/runner/mspec.rb:116:11:in `protect' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `protect' \tfrom mspec/runner/context.rb:176:39:in `$$17' \tfrom <internal:corelib/runtime.js>:1667:5:in `Opal.yieldX' \tfrom <internal:corelib/enumerable.rb>:27:16:in `$$3' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom <internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `all?' \tfrom mspec/runner/context.rb:176:18:in `protect' \tfrom mspec/runner/context.rb:212:26:in `$$21' \tfrom <internal:corelib/runtime.js>:1667:5:in `Opal.yieldX' \tfrom mspec/runner/mspec.rb:284:7:in `repeat' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `repeat' \tfrom mspec/runner/context.rb:204:16:in `$$20' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom mspec/runner/context.rb:203:18:in `process' \tfrom mspec/runner/mspec.rb:55:10:in `describe' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `describe' \tfrom mspec/runner/object.rb:11:10:in `describe' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `describe' \tfrom ruby/core/exception/full_message_spec.rb:3:1:in `Opal.modules.ruby/core/exception/full_message_spec' \tfrom <internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized' \tfrom <internal:corelib/runtime.js>:2721:5:in `load' \tfrom <internal:corelib/kernel.rb>:535:6:in `load' \tfrom mspec/runner/mspec.rb:99:42:in `instance_exec' \tfrom <internal:corelib/basic_object.rb>:125:1:in `instance_exec' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `instance_exec' \tfrom mspec/runner/mspec.rb:116:11:in `protect' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `protect' \tfrom mspec/runner/mspec.rb:99:7:in `$$1' \tfrom <internal:corelib/runtime.js>:1644:7:in `each' \tfrom <internal:corelib/array.rb>:983:1:in `each' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each' \tfrom mspec/runner/mspec.rb:90:12:in `each_file' \tfrom <internal:corelib/runtime.js>:1878:5:in `Opal.send2' \tfrom <internal:corelib/runtime.js>:1866:5:in `each_file' \tfrom mspec/runner/mspec.rb:95:5:in `files' \tfrom mspec/runner/mspec.rb:63:5:in `process' \tfrom tmp/mspec_nodejs.rb:3880:6:in `undefined' \tfrom <internal:corelib/runtime.js>:2805:7:in `<main>' \tfrom tmp/mspec_nodejs.rb:1:1:in `null' \tfrom node:internal/modules/cjs/loader:1105:14:in `Module._compile' \tfrom node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js' \tfrom node:internal/modules/cjs/loader:981:32:in `Module.load' \tfrom node:internal/modules/cjs/loader:822:12:in `Module._load' \tfrom node:internal/modules/run_main:77:12:in `executeUserEntryPoint' \tfrom node:internal/main/run_main_module:17:47:in `undefined' " to include "intermediate exception"
|
31
37
|
fails "Exception#full_message highlights the entire message when the message contains multiple lines" # Expected "<internal:corelib/kernel.rb>:612:37:in `raise': \e[1mfirst line ".start_with? "ruby/core/exception/full_message_spec.rb:62:in `" to be truthy but was false
|
38
|
+
fails "Exception#full_message passes all its own keyword arguments to #detailed_message" # NoMethodError: undefined method `to_tty?' for Exception
|
39
|
+
fails "Exception#full_message relies on #detailed_message" # Expected "ruby/core/exception/full_message_spec.rb:109:23:in `instance_exec': \e[1mnew error (\e[1;4mRuntimeError\e[m\e[1m)\e[m " =~ /DETAILED MESSAGE/ to be truthy but was nil
|
32
40
|
fails "Exception#full_message shows the caller if the exception has no backtrace" # Expected ["ruby/core/exception/full_message_spec.rb:42:21:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/context.rb:176:39:in `$$17'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "<internal:corelib/enumerable.rb>:27:16:in `$$3'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "<internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `all?'", "mspec/runner/context.rb:176:18:in `protect'", "mspec/runner/context.rb:212:26:in `$$21'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "mspec/runner/mspec.rb:284:7:in `repeat'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `repeat'", "mspec/runner/context.rb:204:16:in `$$20'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:203:18:in `process'", "mspec/runner/mspec.rb:55:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "mspec/runner/object.rb:11:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "ruby/core/exception/full_message_spec.rb:3:1:in `Opal.modules.ruby/core/exception/full_message_spec'", "<internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized'", "<internal:corelib/runtime.js>:2721:5:in `load'", "<internal:corelib/kernel.rb>:535:6:in `load'", "mspec/runner/mspec.rb:99:42:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/mspec.rb:99:7:in `$$1'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/mspec.rb:90:12:in `each_file'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each_file'", "mspec/runner/mspec.rb:95:5:in `files'", "mspec/runner/mspec.rb:63:5:in `process'", "tmp/mspec_nodejs.rb:3880:6:in `undefined'", "<internal:corelib/runtime.js>:2805:7:in `<main>'", "tmp/mspec_nodejs.rb:1:1:in `null'", "node:internal/modules/cjs/loader:1105:14:in `Module._compile'", "node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js'", "node:internal/modules/cjs/loader:981:32:in `Module.load'", "node:internal/modules/cjs/loader:822:12:in `Module._load'", "node:internal/modules/run_main:77:12:in `executeUserEntryPoint'", "node:internal/main/run_main_module:17:47:in `undefined'"] == nil to be truthy but was false
|
33
41
|
fails "Exception#full_message shows the exception class at the end of the first line of the message when the message contains multiple lines" # Expected "<internal:corelib/kernel.rb>:612:37:in `raise': first line ".start_with? "ruby/core/exception/full_message_spec.rb:51:in `" to be truthy but was false
|
34
42
|
fails "Exception#full_message supports :highlight option and adds escape sequences to highlight some strings" # Expected "ruby/core/exception/full_message_spec.rb:16:21:in `instance_exec': \e[1mSome runtime error (\e[1;4mRuntimeError\e[m\e[1m)\e[m".end_with? "\e[1mSome runtime error (\e[1;4mRuntimeError\e[m\e[1m)\e[m " to be truthy but was false
|
@@ -40,8 +48,6 @@ opal_filter "Exception" do
|
|
40
48
|
fails "Interrupt.new returns an instance of interrupt with no message given" # NoMethodError: undefined method `signo' for #<Interrupt: Interrupt>
|
41
49
|
fails "Interrupt.new takes an optional message argument" # NoMethodError: undefined method `signo' for #<Interrupt: message>
|
42
50
|
fails "KeyError accepts :receiver and :key options" # ArgumentError: no receiver is available
|
43
|
-
fails "LocalJumpError#exit_value returns the value given to return" # Expected LocalJumpError but got: Exception (unexpected return)
|
44
|
-
fails "LocalJumpError#reason returns 'return' for a return" # Expected LocalJumpError but got: Exception (unexpected return)
|
45
51
|
fails "NameError#dup copies the name and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<MSpecEnv:0x39754>>
|
46
52
|
fails "NameError#name returns a class variable name as a symbol" # Expected nil == "@@doesnt_exist" to be truthy but was false
|
47
53
|
fails "NameError#receiver returns a class when an undefined class variable is called in a subclass' namespace" # NoMethodError: undefined method `receiver' for #<NameError: uninitialized class variable @@doesnt_exist in NameErrorSpecs::ReceiverClass>
|
@@ -54,7 +60,6 @@ opal_filter "Exception" do
|
|
54
60
|
fails "NameError#to_s raises its own message for an undefined variable" # Expected "undefined method `not_defined' for #<MSpecEnv:0xb0b34>" =~ /undefined local variable or method `not_defined'/ to be truthy but was nil
|
55
61
|
fails "NameError.new accepts a :receiver keyword argument" # ArgumentError: [NameError#initialize] wrong number of arguments (given 3, expected -2)
|
56
62
|
fails "NoMethodError#dup copies the name, arguments and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<Object:0x11274>>
|
57
|
-
fails "NoMethodError#message uses #name to display the receiver if it is a class or a module" # Expected "undefined method `foo' for #<Class:0x11230>" == "undefined method `foo' for MyClass:Class" to be truthy but was false
|
58
63
|
fails "NoMethodError.new accepts a :receiver keyword argument" # NoMethodError: undefined method `receiver' for #<NoMethodError: msg>
|
59
64
|
fails "SignalException can be rescued" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502>
|
60
65
|
fails "SignalException cannot be trapped with Signal.trap" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502>
|
data/spec/filters/bugs/file.rb
CHANGED
@@ -10,6 +10,8 @@ opal_filter "File" do
|
|
10
10
|
fails "File.absolute_path? returns false if it's a tricky relative path" # NoMethodError: undefined method `absolute_path?' for File
|
11
11
|
fails "File.absolute_path? returns true if it's an absolute pathname" # NoMethodError: undefined method `absolute_path?' for File
|
12
12
|
fails "File.absolute_path? takes into consideration the platform's root" # NoMethodError: undefined method `absolute_path?' for File
|
13
|
+
fails "File.dirname when level is passed calls #to_int if passed not numeric value" # NoMethodError: undefined method `<' for #<Object:0x56914>
|
14
|
+
fails "File.dirname when level is passed raises ArgumentError if the level is negative" # Expected ArgumentError (negative level: -1) but got: ArgumentError (level can't be negative)
|
13
15
|
fails "File.expand_path accepts objects that have a #to_path method" # ArgumentError: [Dir.home] wrong number of arguments (given 1, expected 0)
|
14
16
|
fails "File.expand_path converts a pathname to an absolute pathname" # ArgumentError: [Dir.home] wrong number of arguments (given 1, expected 0)
|
15
17
|
fails "File.expand_path converts a pathname to an absolute pathname, Ruby-Talk:18512" # ArgumentError: [Dir.home] wrong number of arguments (given 1, expected 0)
|
data/spec/filters/bugs/float.rb
CHANGED
@@ -6,6 +6,7 @@ opal_filter "Float" do
|
|
6
6
|
fails "Float#<=> returns 0 when self is Infinity and other other is infinite?=1" # Expected nil == 0 to be truthy but was false
|
7
7
|
fails "Float#<=> returns 1 when self is Infinity and other is infinite?=-1" # Expected nil == 1 to be truthy but was false
|
8
8
|
fails "Float#<=> returns 1 when self is Infinity and other is infinite?=nil (which means finite)" # Expected nil == 1 to be truthy but was false
|
9
|
+
fails "Float#<=> returns the correct result when one side is infinite" # Expected 0 == 1 to be truthy but was false
|
9
10
|
fails "Float#divmod returns an [quotient, modulus] from dividing self by other" # Expected 0 to be within 18446744073709552000 +/- 0.00004
|
10
11
|
fails "Float#inspect emits a trailing '.0' for a whole number" # Expected "50" == "50.0" to be truthy but was false
|
11
12
|
fails "Float#inspect emits a trailing '.0' for the mantissa in e format" # Expected "100000000000000000000" == "1.0e+20" to be truthy but was false
|
data/spec/filters/bugs/freeze.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_unsupported_filter "freezing" do
|
3
|
-
fails "Date constants freezes MONTHNAMES, DAYNAMES, ABBR_MONTHNAMES, ABBR_DAYSNAMES" # Expected FrozenError (/frozen/) but no exception was raised ([nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Unknown"] was returned)
|
4
3
|
fails "FalseClass#to_s returns a frozen string" # Expected "false".frozen? to be truthy but was false
|
5
4
|
fails "File.basename returns a new unfrozen String" # Expected "foo.rb" not to be identical to "foo.rb"
|
6
|
-
fails "
|
7
|
-
fails "
|
5
|
+
fails "Frozen properties is frozen if the object it is created from is frozen" # Expected false == true to be truthy but was false
|
6
|
+
fails "Frozen properties will be frozen if the object it is created from becomes frozen" # Expected false == true to be truthy but was false
|
7
|
+
fails "FrozenError#receiver should return frozen object that modification was attempted on" # Expected #<Class:#<Object:0x19582>> to be identical to #<Object:0x19582>
|
8
8
|
fails "Hash literal freezes string keys on initialization" # NotImplementedError: String#reverse! not supported. Mutable String methods are not supported in Opal.
|
9
9
|
fails "Kernel#clone with freeze: anything else raises ArgumentError when passed not true/false/nil" # Expected ArgumentError (/unexpected value for freeze: Integer/) but got: ArgumentError (unexpected value for freeze: Number)
|
10
10
|
fails "Kernel#clone with freeze: false calls #initialize_clone with kwargs freeze: false even if #initialize_clone only takes a single argument" # Expected ArgumentError (wrong number of arguments (given 2, expected 1)) but got: ArgumentError ([Clone#initialize_clone] wrong number of arguments (given 2, expected 1))
|
@@ -31,58 +31,14 @@ opal_unsupported_filter "freezing" do
|
|
31
31
|
fails "String#-@ returns a frozen copy if the String is not frozen" # Expected "foo".frozen? to be truthy but was false
|
32
32
|
fails "String#<< raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.)
|
33
33
|
fails "String#<< with Integer raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.)
|
34
|
-
fails "String#capitalize! raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#capitalize! not supported. Mutable String methods are not supported in Opal.)
|
35
|
-
fails "String#chomp! raises a FrozenError on a frozen instance when it is modified" # Expected FrozenError but got: NotImplementedError (String#chomp! not supported. Mutable String methods are not supported in Opal.)
|
36
|
-
fails "String#chomp! raises a FrozenError on a frozen instance when it would not be modified" # Expected FrozenError but got: NotImplementedError (String#chomp! not supported. Mutable String methods are not supported in Opal.)
|
37
|
-
fails "String#chop! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#chop! not supported. Mutable String methods are not supported in Opal.)
|
38
|
-
fails "String#chop! raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#chop! not supported. Mutable String methods are not supported in Opal.)
|
39
|
-
fails "String#clear raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#clear not supported. Mutable String methods are not supported in Opal.)
|
40
34
|
fails "String#concat raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `concat' for "hello")
|
41
35
|
fails "String#concat with Integer raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `concat' for "hello")
|
42
|
-
fails "String#delete! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete!' for "hello")
|
43
|
-
fails "String#delete_prefix! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete_prefix!' for "hello")
|
44
|
-
fails "String#delete_suffix! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete_suffix!' for "hello")
|
45
|
-
fails "String#downcase! raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#downcase! not supported. Mutable String methods are not supported in Opal.)
|
46
|
-
fails "String#encode! raises a FrozenError when called on a frozen String when it's a no-op" # NoMethodError: undefined method `default_internal' for Encoding
|
47
|
-
fails "String#encode! raises a FrozenError when called on a frozen String" # NoMethodError: undefined method `default_internal' for Encoding
|
48
|
-
fails "String#force_encoding raises a FrozenError if self is frozen" # Expected FrozenError but no exception was raised ("abcd" was returned)
|
49
|
-
fails "String#freeze doesn't produce the same object for different instances of literals in the source" # Expected "abc" not to be identical to "abc"
|
50
|
-
fails "String#gsub! with pattern and block raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#gsub! not supported. Mutable String methods are not supported in Opal.)
|
51
|
-
fails "String#gsub! with pattern and replacement raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#gsub! not supported. Mutable String methods are not supported in Opal.)
|
52
36
|
fails "String#initialize with an argument raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but no exception was raised (nil was returned)
|
53
37
|
fails "String#initialize with an argument raises a FrozenError on a frozen instance when self-replacing" # Expected FrozenError but no exception was raised (nil was returned)
|
54
|
-
fails "String#initialize with no arguments does not raise an exception when frozen" # Expected nil to be identical to "hello"
|
55
|
-
fails "String#insert with index, other raises a FrozenError if self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `insert' for "abcd")
|
56
|
-
fails "String#lstrip! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#lstrip! not supported. Mutable String methods are not supported in Opal.)
|
57
|
-
fails "String#lstrip! raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#lstrip! not supported. Mutable String methods are not supported in Opal.)
|
58
38
|
fails "String#next! raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#next! not supported. Mutable String methods are not supported in Opal.)
|
59
|
-
fails "String#prepend raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#prepend not supported. Mutable String methods are not supported in Opal.)
|
60
39
|
fails "String#replace raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NoMethodError (undefined method `replace' for "hello")
|
61
40
|
fails "String#replace raises a FrozenError on a frozen instance when self-replacing" # Expected FrozenError but got: NoMethodError (undefined method `replace' for "hello")
|
62
|
-
fails "String#reverse! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#reverse! not supported. Mutable String methods are not supported in Opal.)
|
63
|
-
fails "String#reverse! raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#reverse! not supported. Mutable String methods are not supported in Opal.)
|
64
|
-
fails "String#rstrip! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NoMethodError (undefined method `rstrip!' for " hello ")
|
65
|
-
fails "String#rstrip! raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NoMethodError (undefined method `rstrip!' for "hello")
|
66
|
-
fails "String#setbyte raises a FrozenError if self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `setbyte' for "cold")
|
67
|
-
fails "String#slice! Range raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
68
|
-
fails "String#slice! Range raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
69
|
-
fails "String#slice! with Regexp raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
70
|
-
fails "String#slice! with Regexp raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
71
|
-
fails "String#slice! with Regexp, index raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
72
|
-
fails "String#slice! with String raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
73
|
-
fails "String#slice! with index raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
74
|
-
fails "String#slice! with index, length raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#slice! not supported. Mutable String methods are not supported in Opal.)
|
75
|
-
fails "String#squeeze! raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#squeeze! not supported. Mutable String methods are not supported in Opal.)
|
76
|
-
fails "String#strip! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NotImplementedError (String#strip! not supported. Mutable String methods are not supported in Opal.)
|
77
|
-
fails "String#strip! raises a FrozenError on a frozen instance that would not be modified" # Expected FrozenError but got: NotImplementedError (String#strip! not supported. Mutable String methods are not supported in Opal.)
|
78
|
-
fails "String#sub! with pattern and block raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#sub! not supported. Mutable String methods are not supported in Opal.)
|
79
|
-
fails "String#sub! with pattern, replacement raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#sub! not supported. Mutable String methods are not supported in Opal.)
|
80
41
|
fails "String#succ! raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#succ! not supported. Mutable String methods are not supported in Opal.)
|
81
|
-
fails "
|
82
|
-
fails "
|
83
|
-
fails "String#tr_s! raises a FrozenError if self is frozen" # Expected FrozenError but got: NotImplementedError (String#tr_s! not supported. Mutable String methods are not supported in Opal.)
|
84
|
-
fails "String#upcase! raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#upcase! not supported. Mutable String methods are not supported in Opal.)
|
85
|
-
fails "Time#localtime on a frozen time does not raise an error if already in the right time zone" # NoMethodError: undefined method `localtime' for 2022-12-07 05:39:36 +0100
|
86
|
-
fails "Time#localtime on a frozen time raises a RuntimeError if the time has a different time zone" # Expected RuntimeError but got: NoMethodError (undefined method `localtime' for 2007-01-09 12:00:00 UTC)
|
87
|
-
fails "TrueClass#to_s returns a frozen string" # Expected "true".frozen? to be truthy but was false
|
42
|
+
fails "Time#localtime on a frozen time does not raise an error if already in the right time zone" # NoMethodError: undefined method `localtime' for 2023-09-20 23:47:50 +0200
|
43
|
+
fails "TrueClass#to_s returns a frozen string" # Expected "true".frozen? to be truthy but was false
|
88
44
|
end
|
data/spec/filters/bugs/hash.rb
CHANGED
@@ -35,4 +35,5 @@ opal_filter "Hash" do
|
|
35
35
|
fails "Hash.ruby2_keywords_hash returns an instance of the subclass if called on an instance of a subclass of Hash" # Expected false == true to be truthy but was false
|
36
36
|
fails "Hash.ruby2_keywords_hash? raises TypeError for non-Hash" # Expected TypeError but no exception was raised (false was returned)
|
37
37
|
fails "Hash.ruby2_keywords_hash? returns true if the Hash is a keywords Hash marked by Module#ruby2_keywords" # Expected false == true to be truthy but was false
|
38
|
+
fails "Hash.try_convert sends #to_hash to the argument and raises TypeError if it's not a kind of Hash" # Expected TypeError (can't convert MockObject to Hash (MockObject#to_hash gives Object)) but got: TypeError (can't convert MockObject into Hash (MockObject#to_hash gives Object))
|
38
39
|
end
|
@@ -1,9 +1,5 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Integer" do
|
3
|
-
fails "Bignum is deprecated" # NameError: uninitialized constant Bignum
|
4
|
-
fails "Bignum is unified into Integer" # NameError: uninitialized constant Bignum
|
5
|
-
fails "Fixnum is deprecated" # Expected warning to match: /constant ::Fixnum is deprecated/ but got: ""
|
6
|
-
fails "Fixnum is unified into Integer" # Expected Number to be identical to Integer
|
7
3
|
fails "Integer is the class of both small and large integers" # Expected Number to be identical to Integer
|
8
4
|
fails "Integer#& fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned)
|
9
5
|
fails "Integer#** bignum switch to a Float when the values is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
|
@@ -19,13 +15,13 @@ opal_filter "Integer" do
|
|
19
15
|
fails "Integer#<< (with n << m) fixnum calls #to_int to convert the argument to an Integer" # Expected 3 == 0 to be truthy but was false
|
20
16
|
fails "Integer#<< (with n << m) fixnum returns -1 when n < 0, m < 0 and n > -(2**-m)" # Expected -7 == -1 to be truthy but was false
|
21
17
|
fails "Integer#<< (with n << m) fixnum returns 0 when n > 0, m < 0 and n < 2**-m" # Expected 7 == 0 to be truthy but was false
|
22
|
-
fails "Integer#<< (with n << m) when m is a bignum or larger than int raises
|
18
|
+
fails "Integer#<< (with n << m) when m is a bignum or larger than int raises RangeError when m > 0 and n != 0" # Expected RangeError (shift width too big) but no exception was raised (1 was returned)
|
23
19
|
fails "Integer#<< (with n << m) when m is a bignum or larger than int returns -1 when m < 0 and n < 0" # Expected 0 == -1 to be truthy but was false
|
24
20
|
fails "Integer#<< (with n << m) when m is a bignum or larger than int returns 0 when m < 0 and n >= 0" # Expected 1 == 0 to be truthy but was false
|
25
21
|
fails "Integer#>> (with n >> m) fixnum calls #to_int to convert the argument to an Integer" # Expected 8 == 0 to be truthy but was false
|
26
22
|
fails "Integer#>> (with n >> m) fixnum returns -1 when n < 0, m > 0 and n > -(2**m)" # Expected -7 == -1 to be truthy but was false
|
27
23
|
fails "Integer#>> (with n >> m) fixnum returns 0 when n > 0, m > 0 and n < 2**m" # Expected 7 == 0 to be truthy but was false
|
28
|
-
fails "Integer#>> (with n >> m) when m is a bignum or larger than int raises
|
24
|
+
fails "Integer#>> (with n >> m) when m is a bignum or larger than int raises RangeError when m < 0 and n != 0" # Expected RangeError (shift width too big) but no exception was raised (1 was returned)
|
29
25
|
fails "Integer#>> (with n >> m) when m is a bignum or larger than int returns -1 when m > 0 and n < 0" # Expected 0 == -1 to be truthy but was false
|
30
26
|
fails "Integer#>> (with n >> m) when m is a bignum or larger than int returns 0 when m > 0 and n >= 0" # Expected 1 == 0 to be truthy but was false
|
31
27
|
fails "Integer#[] fixnum when index and length passed ensures n[i, len] equals to (n >> i) & ((1 << len) - 1)" # ArgumentError: [Number#[]] wrong number of arguments (given 2, expected 1)
|
@@ -43,6 +39,7 @@ opal_filter "Integer" do
|
|
43
39
|
fails "Integer#^ fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (0 was returned)
|
44
40
|
fails "Integer#^ fixnum returns self bitwise EXCLUSIVE OR other" # Expected 5 == 18446744078004520000 to be truthy but was false
|
45
41
|
fails "Integer#^ fixnum returns self bitwise XOR other when one operand is negative" # Expected -3 == -8589934593 to be truthy but was false
|
42
|
+
fails "Integer#ceildiv returns a quotient of division which is rounded up to the nearest integer" # NoMethodError: undefined method `ceildiv' for 0
|
46
43
|
fails "Integer#chr with an encoding argument accepts a String as an argument" # Expected to not get Exception but got: ArgumentError (unknown encoding name - euc-jp)
|
47
44
|
fails "Integer#chr with an encoding argument raises RangeError if self is invalid as a codepoint in the specified encoding" # Expected RangeError but no exception was raised ("\x80" was returned)
|
48
45
|
fails "Integer#chr with an encoding argument raises a RangeError if self is too large" # Expected RangeError but no exception was raised ("膀" was returned)
|
@@ -84,4 +81,6 @@ opal_filter "Integer" do
|
|
84
81
|
fails "Integer#| fixnum returns self bitwise OR other when one operand is negative" # Expected -3 == -8589934593 to be truthy but was false
|
85
82
|
fails "Integer#| fixnum returns self bitwise OR other" # Expected 65535 == 18446744073709617000 to be truthy but was false
|
86
83
|
fails "Integer.sqrt returns the integer square root of the argument" # TypeError: can't convert Number into Integer (Number#to_int gives Number)
|
84
|
+
fails "Integer.try_convert responds with a different error message when it raises a TypeError, depending on the type of the non-Integer object :to_int returns" # Expected TypeError (can't convert MockObject to Integer (MockObject#to_int gives String)) but got: TypeError (can't convert MockObject into Integer (MockObject#to_int gives String))
|
85
|
+
fails "Integer.try_convert sends #to_int to the argument and raises TypeError if it's not a kind of Integer" # Expected TypeError (can't convert MockObject to Integer (MockObject#to_int gives Object)) but got: TypeError (can't convert MockObject into Integer (MockObject#to_int gives Object))
|
87
86
|
end
|
data/spec/filters/bugs/kernel.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Kernel" do
|
3
3
|
fails "Kernel#=== does not call #object_id nor #equal? but still returns true for #== or #=== on the same object" # Mock '#<Object:0x2514>' expected to receive object_id("any_args") exactly 0 times but received it 2 times
|
4
|
-
fails "Kernel#=~ returns nil matching any object" # Expected false to be nil
|
5
4
|
fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the P" # ArgumentError: invalid value for Float(): "0x1_0P10"
|
6
5
|
fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the p" # ArgumentError: invalid value for Float(): "0x1_0p10"
|
7
6
|
fails "Kernel#Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'P'" # ArgumentError: invalid value for Float(): "0x1.8P0"
|
@@ -48,6 +47,7 @@ opal_filter "Kernel" do
|
|
48
47
|
fails "Kernel#eval evaluates string with given filename and negative linenumber" # Expected "unexpected token $end" =~ /speccing.rb:-100:.+/ to be truthy but was nil
|
49
48
|
fails "Kernel#eval includes file and line information in syntax error" # Expected "unexpected token $end" =~ /speccing.rb:1:.+/ to be truthy but was nil
|
50
49
|
fails "Kernel#eval raises a LocalJumpError if there is no lambda-style closure in the chain" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4be5a>
|
50
|
+
fails "Kernel#eval returns from the method calling #eval when evaluating 'return' in BEGIN" # SyntaxError: Unsupported sexp: preexe
|
51
51
|
fails "Kernel#eval unwinds through a Proc-style closure and returns from a lambda-style closure in the closure chain" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4be5a>
|
52
52
|
fails "Kernel#eval updates a local in a scope above a surrounding block scope" # Expected 1 == 2 to be truthy but was false
|
53
53
|
fails "Kernel#eval updates a local in a scope above when modified in a nested block scope" # NoMethodError: undefined method `es' for #<MSpecEnv:0x4be5a>
|
@@ -71,6 +71,7 @@ opal_filter "Kernel" do
|
|
71
71
|
fails "Kernel#initialize_copy does nothing if the argument is the same as the receiver" # Expected nil.equal? #<Object:0x3cb42> to be truthy but was false
|
72
72
|
fails "Kernel#initialize_copy raises FrozenError if the receiver is frozen" # Expected FrozenError but no exception was raised (nil was returned)
|
73
73
|
fails "Kernel#initialize_copy raises TypeError if the objects are of different class" # Expected TypeError (initialize_copy should take same class object) but no exception was raised (nil was returned)
|
74
|
+
fails "Kernel#initialize_copy returns self" # Expected nil.equal? #<Object:0x66548> to be truthy but was false
|
74
75
|
fails "Kernel#inspect returns a String for an object without #class method" # NoMethodError: undefined method `class' for #<Object:0x42c12>
|
75
76
|
fails "Kernel#instance_variable_set on frozen objects accepts unicode instance variable names" # NameError: '@💙' is not allowed as an instance variable name
|
76
77
|
fails "Kernel#instance_variable_set on frozen objects raises for frozen objects" # Expected NameError but got: FrozenError (can't modify frozen NilClass: )
|
@@ -78,8 +79,11 @@ opal_filter "Kernel" do
|
|
78
79
|
fails "Kernel#is_a? does not take into account `class` method overriding" # TypeError: can't define singleton
|
79
80
|
fails "Kernel#kind_of? does not take into account `class` method overriding" # TypeError: can't define singleton
|
80
81
|
fails "Kernel#local_variables is accessible from bindings" # Expected [] to include "a"
|
81
|
-
fails "Kernel#method can be called even if we only
|
82
|
+
fails "Kernel#method can be called even if we only respond_to_missing? method, true" # NameError: undefined method `handled_privately' for class `KernelSpecs::RespondViaMissing'
|
82
83
|
fails "Kernel#method can call a #method_missing accepting zero or one arguments" # NameError: undefined method `foo' for class `#<Class:0x4bc80>'
|
84
|
+
fails "Kernel#method converts the given name to a String using #to_str calls #to_str to convert the given name to a String" # Mock 'method-name' expected to receive to_str("any_args") exactly 1 times but received it 0 times
|
85
|
+
fails "Kernel#method converts the given name to a String using #to_str raises a NoMethodError if the given argument raises a NoMethodError during type coercion to a String" # Expected NoMethodError but got: NameError (undefined method `#<MockObject:0x9e5a6>' for class `Class')
|
86
|
+
fails "Kernel#method converts the given name to a String using #to_str raises a TypeError if the given name can't be converted to a String" # Expected TypeError but got: NameError (undefined method `' for class `Class')
|
83
87
|
fails "Kernel#method returns a method object if respond_to_missing?(method) is true" # NameError: undefined method `handled_publicly' for class `KernelSpecs::RespondViaMissing'
|
84
88
|
fails "Kernel#method the returned method object if respond_to_missing?(method) calls #method_missing with a Symbol name" # NameError: undefined method `handled_publicly' for class `KernelSpecs::RespondViaMissing'
|
85
89
|
fails "Kernel#method will see an alias of the original method as == when in a derived class" # Expected #<Method: KernelSpecs::B#aliased_pub_method (defined in KernelSpecs::B in ruby/core/kernel/fixtures/classes.rb:164)> == #<Method: KernelSpecs::B#pub_method (defined in KernelSpecs::A in ruby/core/kernel/fixtures/classes.rb:164)> to be truthy but was false
|
@@ -115,7 +119,10 @@ opal_filter "Kernel" do
|
|
115
119
|
fails "Kernel#respond_to? throws a type error if argument can't be coerced into a Symbol" # Expected TypeError (/is not a symbol nor a string/) but no exception was raised (false was returned)
|
116
120
|
fails "Kernel#respond_to_missing? causes #respond_to? to return false if called and returning nil" # Expected nil to be false
|
117
121
|
fails "Kernel#respond_to_missing? causes #respond_to? to return true if called and not returning false" # Expected "glark" to be true
|
122
|
+
fails "Kernel#singleton_class for an IO object with a replaced singleton class looks up singleton methods from the fresh singleton class after an object instance got a new one" # NoMethodError: undefined method `reopen' for #<File:0x6c204 @fd="ruby/core/kernel/singleton_class_spec.rb" @flags="r" @eof=false @closed="write">
|
118
123
|
fails "Kernel#singleton_class raises TypeError for Symbol" # Expected TypeError but no exception was raised (#<Class:#<String:0x53aaa>> was returned)
|
124
|
+
fails "Kernel#singleton_class raises TypeError for a frozen deduplicated String" # Expected TypeError (can't define singleton) but no exception was raised (#<Class:#<String:0x6c200>> was returned)
|
125
|
+
fails "Kernel#singleton_class returns a frozen singleton class if object is frozen" # Expected false to be true
|
119
126
|
fails "Kernel#singleton_method find a method defined on the singleton class" # NoMethodError: undefined method `singleton_method' for #<Object:0x4540a>
|
120
127
|
fails "Kernel#singleton_method only looks at singleton methods and not at methods in the class" # Expected NoMethodError == NameError to be truthy but was false
|
121
128
|
fails "Kernel#singleton_method raises a NameError if there is no such method" # Expected NoMethodError == NameError to be truthy but was false
|
@@ -304,12 +311,12 @@ opal_filter "Kernel" do
|
|
304
311
|
fails "Kernel.Float for hexadecimal literals with binary exponent returns 0 for '0x1p-10000'" # ArgumentError: invalid value for Float(): "0x1p-10000"
|
305
312
|
fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1P10000'" # ArgumentError: invalid value for Float(): "0x1P10000"
|
306
313
|
fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1p10000'" # ArgumentError: invalid value for Float(): "0x1p10000"
|
314
|
+
fails "Kernel.Rational raises a TypeError if the first argument is a Symbol" # Expected TypeError but no exception was raised ((0/1) was returned)
|
315
|
+
fails "Kernel.Rational raises a TypeError if the second argument is a Symbol" # Expected TypeError but got: ZeroDivisionError (divided by 0)
|
316
|
+
fails "Kernel.Rational when passed a Numeric calls #to_r to convert the first argument to a Rational" # NoMethodError: undefined method `/' for #<RationalSpecs::SubNumeric:0x8bc3a @value=(2/1)>
|
307
317
|
fails "Kernel.Rational when passed a String converts the String to a Rational using the same method as String#to_r" # Expected (0/1) == (13/25) to be truthy but was false
|
308
318
|
fails "Kernel.Rational when passed a String does not use the same method as Float#to_r" # Expected (5404319552844595/9007199254740992) == (3/5) to be truthy but was false
|
309
|
-
fails "Kernel.Rational when passed a String raises a TypeError if the first argument is a Symbol" # Expected TypeError but no exception was raised ((0/1) was returned)
|
310
|
-
fails "Kernel.Rational when passed a String raises a TypeError if the second argument is a Symbol" # Expected TypeError but got: ZeroDivisionError (divided by 0)
|
311
319
|
fails "Kernel.Rational when passed a String scales the Rational value of the first argument by the Rational value of the second" # ZeroDivisionError: divided by 0
|
312
|
-
fails "Kernel.Rational when passed a String when passed a Numeric calls #to_r to convert the first argument to a Rational" # NoMethodError: undefined method `/' for #<RationalSpecs::SubNumeric:0x2b4dc @value=(2/1)>
|
313
320
|
fails "Kernel.Rational when passed exception: false and [anything, non-Numeric] swallows an error" # ArgumentError: [MSpecEnv#Rational] wrong number of arguments (given 3, expected -2)
|
314
321
|
fails "Kernel.Rational when passed exception: false and [non-Numeric, Numeric] swallows an error" # ArgumentError: [MSpecEnv#Rational] wrong number of arguments (given 3, expected -2)
|
315
322
|
fails "Kernel.Rational when passed exception: false and [non-Numeric] swallows an error" # NoMethodError: undefined method `to_i' for {"exception"=>false}
|