repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/base64.rb
spec/filters/bugs/base64.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Base64" do fails "Base64#decode64 returns a binary encoded string" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false fails "Base64#decode64 returns the Base64-decoded version of the given string with wrong padding" # Expected "]M\u0095¹\u0090\u0081É\u0095¥¹\u0099½É\u008D\u0095µ\u0095¹ÑÌ" == "]M\x95¹\x90\x81ɕ¥¹\x99½ɍ\x95µ\x95¹ÑÌ" to be truthy but was false fails "Base64#encode64 returns a US_ASCII encoded string" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Base64#strict_decode64 raises ArgumentError when the given string contains an invalid character" # Expected ArgumentError but no exception was raised ("Ü" was returned) fails "Base64#strict_decode64 raises ArgumentError when the given string has wrong padding" # Expected ArgumentError but no exception was raised ("\u0001M\u0095¹\u0090\u0081É\u0095¥¹\u0099½É\u008D\u0095µ\u0095¹ÑÌ" was returned) fails "Base64#strict_decode64 returns a binary encoded string" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false fails "Base64#strict_encode64 returns a US_ASCII encoded string" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/freeze.rb
spec/filters/bugs/freeze.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "freezing" do fails "FalseClass#to_s returns a frozen string" # Expected "false".frozen? to be truthy but was false fails "File.basename returns a new unfrozen String" # Expected "foo.rb" not to be identical to "foo.rb" fails "Frozen properties is frozen if the object it is created from is frozen" # Expected false == true to be truthy but was false fails "Frozen properties will be frozen if the object it is created from becomes frozen" # Expected false == true to be truthy but was false fails "FrozenError#receiver should return frozen object that modification was attempted on" # Expected #<Class:#<Object:0x19582>> to be identical to #<Object:0x19582> fails "Hash literal freezes string keys on initialization" # NotImplementedError: String#reverse! not supported. Mutable String methods are not supported in Opal. 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) 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)) fails "Kernel#clone with freeze: true calls #initialize_clone with kwargs freeze: true 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)) fails "Kernel#freeze causes mutative calls to raise RuntimeError" # Expected RuntimeError but no exception was raised (1 was returned) fails "Kernel#freeze on a Symbol has no effect since it is already frozen" # Expected false to be true fails "Kernel#frozen? on a Symbol returns true" # Expected false to be true fails "Literal Regexps is frozen" # Expected /Hello/.frozen? to be truthy but was false fails "Marshal.load when called with freeze: true does not freeze classes" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true does not freeze modules" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen arrays" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen hashes" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen regexps" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true when called with a proc call the proc with frozen objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 3, expected 1) fails "Marshal.load when called with freeze: true when called with a proc does not freeze the object returned by the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 3, expected 1) fails "MatchData#string returns a frozen copy of the match string" # Expected "THX1138.".frozen? to be truthy but was false fails "Module#name returns a frozen String" # Expected "ModuleSpecs".frozen? to be truthy but was false fails "NilClass#to_s returns a frozen string" # Expected "".frozen? to be truthy but was false fails "Proc#[] with frozen_string_literals doesn't duplicate frozen strings" # Expected false to be true fails "Regexp#initialize raises a FrozenError on a Regexp literal" # Expected FrozenError but no exception was raised (nil was returned) fails "String#-@ deduplicates frozen strings" # Expected "this string is frozen" not to be identical to "this string is frozen" fails "String#-@ returns a frozen copy if the String is not frozen" # Expected "foo".frozen? to be truthy but was false 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.) 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.) fails "String#concat raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `concat' for "hello") fails "String#concat with Integer raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `concat' for "hello") 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) 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) 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.) fails "String#replace raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NoMethodError (undefined method `replace' for "hello") fails "String#replace raises a FrozenError on a frozen instance when self-replacing" # Expected FrozenError but got: NoMethodError (undefined method `replace' for "hello") 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.) 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 fails "TrueClass#to_s returns a frozen string" # Expected "true".frozen? to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/enumerator.rb
spec/filters/bugs/enumerator.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Enumerator" do fails "Enumerator#feed can be called for each iteration" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#feed causes yield to return the value if called during iteration" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#feed raises a TypeError if called more than once without advancing the enumerator" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#feed returns nil" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#feed sets the future return value of yield if called before advancing the iterator" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#feed sets the return value of Yielder#yield" # NotImplementedError: Opal doesn't support Enumerator#feed fails "Enumerator#initialize returns self when given a block" # Expected nil to be identical to #<Enumerator: #<Enumerator::Generator:0x4ef82 @block=#<Proc:0x4efa6>>:each> fails "Enumerator#initialize sets size to nil if size is not given" # NoMethodError: undefined method `size' for nil fails "Enumerator#initialize sets size to nil if the given size is nil" # NoMethodError: undefined method `size' for nil fails "Enumerator#initialize sets size to the given size if the given size is Float::INFINITY" # Expected 4 to be identical to Infinity fails "Enumerator#initialize sets size to the given size if the given size is a Proc" # NoMethodError: undefined method `size' for nil 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 fails "Enumerator#inspect returns a not initialized representation if #initialized is not called yet" # NoMethodError: undefined method `any?' for nil fails "Enumerator.new no block given raises" # Expected ArgumentError but no exception was raised (#<Enumerator: 1:upto(3)> was returned) fails "Enumerator.new when passed a block yielded values handles yield arguments properly" # Expected 1 == [1, 2] to be truthy but was false fails "Enumerator.produce creates an infinite enumerator" # NoMethodError: undefined method `produce' for Enumerator fails "Enumerator.produce terminates iteration when block raises StopIteration exception" # NoMethodError: undefined method `produce' for Enumerator fails "Enumerator.produce when initial value skipped starts enumerable from result of first block call" # NoMethodError: undefined method `produce' for Enumerator fails "Enumerator.produce when initial value skipped uses nil instead" # NoMethodError: undefined method `produce' for Enumerator fails "Enumerator.product accepts a block" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product accepts a list of enumerators of any length" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product accepts infinite enumerators and returns infinite enumerator" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product calls #each_entry lazily" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product calls only #each_entry method on arguments" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product iterates through consuming enumerator elements only once" # NoMethodError: undefined method `product' for Enumerator 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) fails "Enumerator.product reject keyword arguments" # Expected ArgumentError (unknown keywords: :foo, :bar) but got: NoMethodError (undefined method `product' for Enumerator) fails "Enumerator.product returns a Cartesian product of enumerators" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product returns an enumerator with an empty array when no arguments passed" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product returns an instance of Enumerator::Product" # NoMethodError: undefined method `product' for Enumerator fails "Enumerator.product returns nil when a block passed" # NoMethodError: undefined method `product' for Enumerator 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) fails "Enumerator::ArithmeticSequence.new is not defined" # Expected NoMethodError but got: ArgumentError ([ArithmeticSequence#initialize] wrong number of arguments (given 0, expected -2)) 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 fails "Enumerator::Generator#each returns the block returned value" # Expected #<Enumerator::Generator:0x3f346 @block=#<Proc:0x3f40c>> to be identical to "block_returned" fails "Enumerator::Generator#initialize returns self when given a block" # Expected #<Proc:0x3ff5e> to be identical to #<Enumerator::Generator:0x3ff52 @block=#<Proc:0x3ff5e>> 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" fails "Enumerator::Lazy#chunk calls the block with gathered values when yield with multiple arguments" # NoMethodError: undefined method `force' for #<Enumerator: #<Enumerator::Generator:0x43cdc @block=#<Proc:0x43cde>>:each> fails "Enumerator::Lazy#chunk on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#chunk returns a new instance of Enumerator::Lazy" # Expected #<Enumerator: #<Enumerator::Generator:0x43cc2 @block=#<Proc:0x43cc6>>:each> (Enumerator) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#chunk returns an Enumerator if called without a block" # NoMethodError: undefined method `force' for #<Enumerator: #<Enumerator::Generator:0x43caa @block=#<Proc:0x43cac>>:each> fails "Enumerator::Lazy#chunk when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#chunk works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#chunk_while should return a lazy enumerator" # Expected #<Enumerator: #<Enumerator::Generator:0x4e058 @block=#<Proc:0x4e05c>>:each> (Enumerator) to be kind of Enumerator::Lazy fails "Enumerator::Lazy#chunk_while works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect_concat on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect_concat on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#collect_concat when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force" # TypeError: can't iterate from Float 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 fails "Enumerator::Lazy#collect_concat works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#compact returns array without nil elements" # Expected [1, 3, false, 5] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#compact sets #size to nil" # NoMethodError: undefined method `each' for #<Object:0x9caea> 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 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 fails "Enumerator::Lazy#drop sets difference of given count with old size to new size" # Expected 20 == 80 to be truthy but was false fails "Enumerator::Lazy#drop when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#drop works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#drop_while on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#drop_while when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#drop_while works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#eager does not enumerate an enumerator" # NoMethodError: undefined method `eager' for #<Enumerator::Lazy: [1, 2, 3]> fails "Enumerator::Lazy#eager returns a non-lazy Enumerator converted from the lazy enumerator" # NoMethodError: undefined method `eager' for #<Enumerator::Lazy: [1, 2, 3]> fails "Enumerator::Lazy#enum_for generates a lazy enumerator from the given name" # TypeError: can't iterate from Float fails "Enumerator::Lazy#enum_for passes given arguments to wrapped method" # TypeError: can't iterate from Float fails "Enumerator::Lazy#enum_for works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#filter calls the block with a gathered array when yield with multiple arguments" # Expected [nil, 0, 0, 0, 0, nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#filter on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#filter when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#filter works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#filter_map does not map false results" # TypeError: can't iterate from Float fails "Enumerator::Lazy#filter_map maps only truthy results" # TypeError: can't iterate from Float fails "Enumerator::Lazy#find_all calls the block with a gathered array when yield with multiple arguments" # Expected [nil, 0, 0, 0, 0, nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#find_all on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#find_all when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#find_all works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#flat_map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force" # TypeError: can't iterate from Float fails "Enumerator::Lazy#flat_map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#flat_map when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force" # TypeError: can't iterate from Float fails "Enumerator::Lazy#flat_map when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#flat_map works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#force on a nested Lazy calls all block and returns an Array" # TypeError: can't iterate from Float fails "Enumerator::Lazy#force passes given arguments to receiver.each" # Expected [[], 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "arg1", ["arg2", "arg3"], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "arg1", ["arg2", "arg3"], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#force works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep calls the block with a gathered array when yield with multiple arguments" # Expected [[], [], 0, 0, [0, 1], [...], [0, 1, 2], [...], [0, 1, 2], [...], nil, nil, "default_arg", "default_arg", [], [], [], [], [0], [...], [0, 1], [...], [0, 1, 2], [...]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#grep on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep_v calls the block with a gathered array when yield with multiple arguments" # NoMethodError: undefined method `force' for [[nil, 0, nil, "default_arg"], [nil, 0, nil, "default_arg"], [nil, 0, nil, "default_arg"], [nil, 0, nil, "default_arg"]] fails "Enumerator::Lazy#grep_v on a nested Lazy sets #size to nil" # NoMethodError: undefined method `each' for #<Object:0x7b884> fails "Enumerator::Lazy#grep_v on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep_v on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep_v returns a new instance of Enumerator::Lazy" # Expected [] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#grep_v sets #size to nil" # NoMethodError: undefined method `each' for #<Object:0x7b738> fails "Enumerator::Lazy#grep_v sets $~ in the block" # NoMethodError: undefined method `force' for [nil] fails "Enumerator::Lazy#grep_v sets $~ in the next block with each" # Expected #<MatchData "e"> == nil to be truthy but was false fails "Enumerator::Lazy#grep_v sets $~ in the next block with map" # Expected #<MatchData "e"> == nil to be truthy but was false fails "Enumerator::Lazy#grep_v when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep_v when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#grep_v works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#initialize returns self" # Expected nil to be identical to #<Enumerator::Lazy: #<Object:0xa73bc>> fails "Enumerator::Lazy#initialize sets #size to nil if given size is nil" # NoMethodError: undefined method `size' for nil fails "Enumerator::Lazy#initialize sets #size to nil if not given a size" # NoMethodError: undefined method `size' for nil fails "Enumerator::Lazy#initialize sets given size to own size if the given size is Float::INFINITY" # Expected 4 to be identical to Infinity fails "Enumerator::Lazy#initialize sets given size to own size if the given size is a Proc" # NoMethodError: undefined method `size' for nil fails "Enumerator::Lazy#initialize sets given size to own size if the given size is an Integer" # Expected 4 == 100 to be truthy but was false fails "Enumerator::Lazy#initialize when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # NoMethodError: undefined method `first' for nil fails "Enumerator::Lazy#map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#map when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#map works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#reject calls the block with a gathered array when yield with multiple arguments" # Expected [nil, 0, 0, 0, 0, nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#reject on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#reject when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#reject works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#select calls the block with a gathered array when yield with multiple arguments" # Expected [nil, 0, 0, 0, 0, nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false fails "Enumerator::Lazy#select doesn't over-evaluate when peeked" # NoMethodError: undefined method `length' for #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: ["Text1", "Text2", "Text3"]>>> fails "Enumerator::Lazy#select doesn't pre-evaluate the next element" # NoMethodError: undefined method `length' for #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: ["Text1", "Text2", "Text3"]>>> fails "Enumerator::Lazy#select doesn't re-evaluate after peek" # NoMethodError: undefined method `length' for #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: ["Text1", "Text2", "Text3"]>>> fails "Enumerator::Lazy#select on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#select when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#select works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#slice_after should return a lazy enumerator" # Expected #<Enumerator: #<Enumerator::Generator:0x3305c @block=#<Proc:0x33060>>:each> (Enumerator) to be kind of Enumerator::Lazy fails "Enumerator::Lazy#slice_after works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#slice_before should return a lazy enumerator" # Expected #<Enumerator: #<Enumerator::Generator:0x66168 @block=#<Proc:0x6616c>>:each> (Enumerator) to be kind of Enumerator::Lazy fails "Enumerator::Lazy#slice_before works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#slice_when should return a lazy enumerator" # Expected #<Enumerator: #<Enumerator::Generator:0x86660 @block=#<Proc:0x86664>>:each> (Enumerator) to be kind of Enumerator::Lazy fails "Enumerator::Lazy#slice_when works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#take on a nested Lazy when the returned lazy enumerator is evaluated by .force stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#take on a nested Lazy when the returned lazy enumerator is evaluated by .force stops without iterations if the given argument is 0" # Expected ["before_yield"] == [] to be truthy but was false fails "Enumerator::Lazy#take sets given count to size if the old size is Infinity" # Expected Infinity == 20 to be truthy but was false fails "Enumerator::Lazy#take when the returned lazy enumerator is evaluated by .force stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#take when the returned lazy enumerator is evaluated by .force stops without iterations if the given argument is 0" # Expected ["before_yield"] == [] to be truthy but was false fails "Enumerator::Lazy#take_while on a nested Lazy when the returned lazy enumerator is evaluated by .force stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#take_while when the returned lazy enumerator is evaluated by .force stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#to_enum generates a lazy enumerator from the given name" # TypeError: can't iterate from Float fails "Enumerator::Lazy#to_enum passes given arguments to wrapped method" # TypeError: can't iterate from Float fails "Enumerator::Lazy#to_enum works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#uniq when yielded with an argument return same value after rewind" # NoMethodError: undefined method `force' for [0, 1] fails "Enumerator::Lazy#uniq when yielded with an argument returns a lazy enumerator" # Expected [0, 1] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#uniq when yielded with an argument sets the size to nil" # Expected 2 == nil to be truthy but was false fails "Enumerator::Lazy#uniq when yielded with multiple arguments return same value after rewind" # NoMethodError: undefined method `force' for [[0, "foo"], [2, "bar"]] fails "Enumerator::Lazy#uniq when yielded with multiple arguments returns all yield arguments as an array" # NoMethodError: undefined method `force' for [[0, "foo"], [2, "bar"]] fails "Enumerator::Lazy#uniq without block return same value after rewind" # NoMethodError: undefined method `force' for [0, 1] fails "Enumerator::Lazy#uniq without block returns a lazy enumerator" # Expected [0, 1] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#uniq without block sets the size to nil" # Expected 2 == nil to be truthy but was false fails "Enumerator::Lazy#uniq works with an infinite enumerable" # TypeError: can't iterate from Float fails "Enumerator::Lazy#with_index enumerates with a given block" # TypeError: can't iterate from Float fails "Enumerator::Lazy#with_index enumerates with an index starting at 0 when offset is nil" # TypeError: can't iterate from Float fails "Enumerator::Lazy#with_index enumerates with an index starting at a given offset" # TypeError: can't iterate from Float fails "Enumerator::Lazy#with_index enumerates with an index" # TypeError: can't iterate from Float fails "Enumerator::Lazy#zip calls the block with a gathered array when yield with multiple arguments" # NoMethodError: undefined method `force' for [[[], []], [0, 0], [[0, 1], [0, 1]], [[0, 1, 2], [0, 1, 2]], [[0, 1, 2], [0, 1, 2]], [nil, nil], ["default_arg", "default_arg"], [[], []], [[], []], [[0], [0]], [[0, 1], [0, 1]], [[0, 1, 2], [0, 1, 2]]] fails "Enumerator::Lazy#zip keeps size" # NoMethodError: undefined method `each' for #<Object:0xb6158> fails "Enumerator::Lazy#zip on a nested Lazy keeps size" # NoMethodError: undefined method `each' for #<Object:0xb62fe> fails "Enumerator::Lazy#zip on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#zip raises a TypeError if arguments contain non-list object" # Expected TypeError but got: NoMethodError (undefined method `each' for #<Object:0xb624e>) fails "Enumerator::Lazy#zip returns a Lazy when no arguments given" # Expected [[[]], [0], [[0, 1]], [[0, 1, 2]], [[0, 1, 2]], [nil], ["default_arg"], [[]], [[]], [[0]], [[0, 1]], [[0, 1, 2]]] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#zip returns a new instance of Enumerator::Lazy" # Expected [[[], nil], [0, nil], [[0, 1], nil], [[0, 1, 2], nil], [[0, 1, 2], nil], [nil, nil], ["default_arg", nil], [[], nil], [[], nil], [[0], nil], [[0, 1], nil], [[0, 1, 2], nil]] (Array) to be an instance of Enumerator::Lazy fails "Enumerator::Lazy#zip when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # TypeError: can't iterate from Float fails "Enumerator::Lazy#zip works with an infinite enumerable and an array" # TypeError: can't iterate from Float fails "Enumerator::Lazy#zip works with two infinite enumerables" # TypeError: can't iterate from Float fails "SimpleDelegator can be marshalled" # Expected String == SimpleDelegator to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/exception.rb
spec/filters/bugs/exception.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Exception" do fails "An Exception reaching the top level is printed on STDERR" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x830fa> fails "An Exception reaching the top level the Exception#cause is printed to STDERR with backtraces" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x830fa> fails "An Exception reaching the top level with a custom backtrace is printed on STDERR" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x830fa> fails "Errno::EAGAIN is the same class as Errno::EWOULDBLOCK if they represent the same errno value" # NameError: uninitialized constant Errno::EAGAIN fails "Errno::EINVAL.new accepts an optional custom message and location" # ArgumentError: [EINVAL.new] wrong number of arguments (given 2, expected -1) fails "Errno::EINVAL.new accepts an optional custom message" # Expected 22 == Errno to be truthy but was false fails "Errno::EINVAL.new can be called with no arguments" # Expected 22 == Errno to be truthy but was false fails "Errno::ENOTSUP is defined" # Expected Errno to have constant 'ENOTSUP' but it does not fails "Errno::ENOTSUP is the same class as Errno::EOPNOTSUPP if they represent the same errno value" # NameError: uninitialized constant Errno::ENOTSUP fails "Exception#== returns true if both exceptions have the same class, no message, and no backtrace" # Expected #<RuntimeError: RuntimeError> == #<RuntimeError: RuntimeError> to be truthy but was false fails "Exception#== returns true if both exceptions have the same class, the same message, and no backtrace" # Expected #<TypeError: message> == #<TypeError: message> to be truthy but was false fails "Exception#== returns true if both exceptions have the same class, the same message, and the same backtrace" # Expected #<TypeError: message> == #<TypeError: message> to be truthy but was false fails "Exception#== returns true if one exception is the dup'd copy of the other" # Expected #<ArgumentError: ArgumentError> == #<ArgumentError: ArgumentError> to be truthy but was false fails "Exception#== returns true if the two objects subclass Exception and have the same message and backtrace" # Expected #<ExceptionSpecs::UnExceptional: ExceptionSpecs::UnExceptional> == #<ExceptionSpecs::UnExceptional: ExceptionSpecs::UnExceptional> to be truthy but was false fails "Exception#backtrace captures the backtrace for an exception into $!" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /backtrace_spec/ to be truthy but was nil fails "Exception#backtrace captures the backtrace for an exception into $@" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /backtrace_spec/ to be truthy but was nil fails "Exception#backtrace includes the filename of the location immediately prior to where self raised in the second element" # Expected "ruby/core/exception/fixtures/common.rb:7:9:in `backtrace'" =~ /backtrace_spec\.rb/ to be truthy but was nil fails "Exception#backtrace includes the filename of the location where self raised in the first element" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /common\.rb/ to be truthy but was nil fails "Exception#backtrace includes the line number of the location immediately prior to where self raised in the second element" # Expected "ruby/core/exception/fixtures/common.rb:7:9:in `backtrace'" =~ /:6(:in )?/ to be truthy but was nil fails "Exception#backtrace includes the line number of the location where self raised in the first element" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /:7:in / to be truthy but was nil fails "Exception#backtrace includes the name of the method from where self raised in the first element" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /in `backtrace'/ to be truthy but was nil fails "Exception#backtrace returns nil if no backtrace was set" # Expected ["ruby/core/exception/backtrace_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_spec.rb:4:1:in `Opal.modules.ruby/core/exception/backtrace_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 fails "Exception#backtrace_locations produces a backtrace for an exception captured using $!" # Expected "<internal:corelib/kernel.rb>" =~ /backtrace_locations_spec/ to be truthy but was nil 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 fails "Exception#cause is set for internal errors caused by user errors" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Exception#cause is set for user errors caused by internal errors" # Expected RuntimeError but no exception was raised (Infinity was returned) fails "Exception#detailed_message accepts highlight keyword argument and adds escape control sequences" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error> fails "Exception#detailed_message allows and ignores other keyword arguments" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error> fails "Exception#detailed_message returns 'unhandled exception' for an instance of RuntimeError with empty message" # NoMethodError: undefined method `detailed_message' for RuntimeError 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> fails "Exception#detailed_message returns decorated message" # NoMethodError: undefined method `detailed_message' for #<RuntimeError: new error> fails "Exception#detailed_message returns just a message if exception class is anonymous" # NoMethodError: undefined method `detailed_message' for #<#<Class:0x4b742>: message> 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 fails "Exception#exception captures an exception into $!" # Expected "<internal:corelib/kernel.rb>:609:37:in `raise'" =~ /exception_spec/ to be truthy but was nil 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 fails "Exception#full_message passes all its own keyword arguments to #detailed_message" # NoMethodError: undefined method `to_tty?' for Exception 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 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 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 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 fails "Exception#set_backtrace raises a TypeError when passed a Symbol" # Expected TypeError but no exception was raised ("unhappy" was returned) fails "Exception#set_backtrace raises a TypeError when the Array contains a Symbol" # Expected TypeError but no exception was raised (["String", "unhappy"] was returned) fails "Exception#to_s calls #to_s on the message" # Mock 'message' expected to receive to_s("any_args") exactly 1 times but received it 2 times fails "Interrupt is raised on the main Thread by the default SIGINT handler" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52262> fails "Interrupt.new returns an instance of interrupt with no message given" # NoMethodError: undefined method `signo' for #<Interrupt: Interrupt> fails "Interrupt.new takes an optional message argument" # NoMethodError: undefined method `signo' for #<Interrupt: message> fails "KeyError accepts :receiver and :key options" # ArgumentError: no receiver is available fails "NameError#dup copies the name and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<MSpecEnv:0x39754>> fails "NameError#name returns a class variable name as a symbol" # Expected nil == "@@doesnt_exist" to be truthy but was false 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> fails "NameError#receiver returns a class when an undefined constant is called" # NoMethodError: undefined method `receiver' for #<NameError: uninitialized constant NameErrorSpecs::ReceiverClass::DoesntExist> fails "NameError#receiver returns the Object class when an undefined class variable is called" # NoMethodError: undefined method `receiver' for #<NameError: uninitialized class variable @@doesnt_exist in > fails "NameError#receiver returns the Object class when an undefined constant is called without namespace" # NoMethodError: undefined method `receiver' for #<NameError: uninitialized constant DoesntExist> fails "NameError#receiver returns the object that raised the exception" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `doesnt_exist' for #<Object:0x1a114>> fails "NameError#receiver returns the receiver when raised from #class_variable_get" # NoMethodError: undefined method `receiver' for #<NameError: `invalid_cvar_name' is not allowed as a class variable name> fails "NameError#receiver returns the receiver when raised from #instance_variable_get" # NoMethodError: undefined method `receiver' for #<NameError: 'invalid_ivar_name' is not allowed as an instance variable name> 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 fails "NameError.new accepts a :receiver keyword argument" # ArgumentError: [NameError#initialize] wrong number of arguments (given 3, expected -2) fails "NoMethodError#dup copies the name, arguments and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<Object:0x11274>> fails "NoMethodError.new accepts a :receiver keyword argument" # NoMethodError: undefined method `receiver' for #<NoMethodError: msg> fails "SignalException can be rescued" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502> fails "SignalException cannot be trapped with Signal.trap" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502> fails "SignalException runs after at_exit" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502> fails "SignalException self-signals for USR1" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x52502> fails "SignalException#signm returns the signal name" # Expected SignalException but got: NoMethodError (undefined method `kill' for Process) fails "SignalException#signo returns the signal number" # Expected SignalException but got: NoMethodError (undefined method `kill' for Process) fails "SignalException.new raises an exception for an optional argument with a signal name" # Expected ArgumentError but no exception was raised (#<SignalException: INT> was returned) fails "SignalException.new raises an exception with an invalid first argument type" # Expected ArgumentError but no exception was raised (#<SignalException: #<Object:0x52564>> was returned) fails "SignalException.new raises an exception with an invalid signal name" # Expected ArgumentError but no exception was raised (#<SignalException: NONEXISTENT> was returned) fails "SignalException.new raises an exception with an invalid signal number" # Expected ArgumentError but no exception was raised (#<SignalException: 100000> was returned) fails "SignalException.new takes a signal name with SIG prefix as the first argument" # NoMethodError: undefined method `signo' for #<SignalException: SIGINT> fails "SignalException.new takes a signal name without SIG prefix as the first argument" # NoMethodError: undefined method `signo' for #<SignalException: INT> fails "SignalException.new takes a signal number as the first argument" # NoMethodError: undefined method `list' for Signal fails "SignalException.new takes a signal symbol with SIG prefix as the first argument" # NoMethodError: undefined method `signo' for #<SignalException: SIGINT> fails "SignalException.new takes a signal symbol without SIG prefix as the first argument" # NoMethodError: undefined method `signo' for #<SignalException: INT> fails "SignalException.new takes an optional message argument with a signal number" # NoMethodError: undefined method `list' for Signal fails "StopIteration#result returns the method-returned-object from an Enumerator" # Expected nil to be identical to "method_returned" fails "SystemCallError#backtrace is nil if not raised" # Expected ["ruby/core/exception/system_call_error_spec.rb:141:20: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/system_call_error_spec.rb:139:1:in `Opal.modules.ruby/core/exception/system_call_error_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 fails "SystemCallError#dup copies the errno" # Expected nil == 42 to be truthy but was false fails "SystemCallError#errno returns the errno given as optional argument to new" # Expected nil == -1048576 to be truthy but was false fails "SystemCallError#message returns the default message when no message is given" # Expected "268435456" =~ /Unknown error/i to be truthy but was nil fails "SystemCallError.=== returns false if errnos different" # NoMethodError: undefined method `+' for Errno fails "SystemCallError.=== returns true if errnos same" # Expected false == true to be truthy but was false fails "SystemCallError.new accepts an optional custom message preceding the errno" # Expected #<SystemCallError: custom message> (SystemCallError) to be an instance of Errno::EINVAL fails "SystemCallError.new accepts an optional third argument specifying the location" # Expected #<SystemCallError: custom message> (SystemCallError) to be an instance of Errno::EINVAL fails "SystemCallError.new accepts single Integer argument as errno" # Expected nil == -16777216 to be truthy but was false fails "SystemCallError.new coerces location if it is not a String" # Expected "foo" =~ /@ not_a_string - foo/ to be truthy but was nil fails "SystemCallError.new constructs the appropriate Errno class" # Expected #<SystemCallError: Errno> (SystemCallError) to be an instance of Errno::EINVAL fails "SystemCallError.new converts to Integer if errno is a Complex convertible to Integer" # Expected #<SystemCallError: foo> == #<SystemCallError: foo> to be truthy but was false fails "SystemCallError.new converts to Integer if errno is a Float" # Expected #<SystemCallError: foo> == #<SystemCallError: foo> to be truthy but was false fails "SystemCallError.new raises RangeError if errno is a Complex not convertible to Integer" # Expected RangeError (/can't convert/) but no exception was raised (#<SystemCallError: foo> was returned) fails "SystemCallError.new raises TypeError if errno is not an Integer" # Expected TypeError (/no implicit conversion of String into Integer/) but no exception was raised (#<SystemCallError: foo> was returned) fails "SystemCallError.new raises TypeError if message is not a String" # Expected TypeError (/no implicit conversion of Symbol into String/) but no exception was raised (#<SystemCallError: foo> was returned) fails "SystemCallError.new requires at least one argument" # Expected ArgumentError but no exception was raised (#<SystemCallError: SystemCallError> was returned) fails "SystemExit #initialize accepts a message only" # NoMethodError: undefined method `status' for #<SystemExit: message> fails "SystemExit #initialize accepts a status and message" # NoMethodError: undefined method `status' for #<SystemExit: 42> fails "SystemExit #initialize accepts a status only" # NoMethodError: undefined method `status' for #<SystemExit: 42> fails "SystemExit #initialize accepts no arguments" # NoMethodError: undefined method `status' for #<SystemExit: SystemExit> fails "SystemExit sets the exit status and exits silently when raised when subclassed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x9fe6a> fails "SystemExit sets the exit status and exits silently when raised" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x9fe6a> fails_badly "SystemExit#status returns the exit status" fails_badly "SystemExit#success? returns false if the process exited unsuccessfully" fails_badly "SystemExit#success? returns true if the process exited successfully" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/class.rb
spec/filters/bugs/class.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Class" do fails "Class#allocate raises TypeError for #superclass" # Expected TypeError but no exception was raised (nil was returned) fails "Class#dup raises TypeError if called on BasicObject" # Expected TypeError (can't copy the root class) but got: Exception (Cannot read properties of null (reading '$$is_number')) fails "Class#initialize raises a TypeError when called on BasicObject" # Expected TypeError but no exception was raised (nil was returned) fails "Class#initialize raises a TypeError when called on already initialized classes" # Expected TypeError but no exception was raised (nil was returned) fails "Class#initialize when given the Class raises a TypeError" # Expected TypeError but got: ArgumentError ([.initialize] wrong number of arguments (given 1, expected 0)) fails "Class#new uses the internal allocator and does not call #allocate" # RuntimeError: allocate should not be called fails "Class#subclasses works when creating subclasses concurrently" # NotImplementedError: Thread creation not available fails "Class.new raises a TypeError if passed a metaclass" # Expected TypeError but no exception was raised (#<Class:0x34cae> was returned) fails_badly "Class#descendants returns a list of classes descended from self (excluding self)" # GC/Spec order issue. Expected [#<Class:0x2e77c>, #<Class:0x2e79a>, #<Class:0x37368>, ModuleSpecs::Child, ModuleSpecs::Child2, ModuleSpecs::Grandchild] == [ModuleSpecs::Child, ModuleSpecs::Child2, ModuleSpecs::Grandchild] to be truthy but was false fails_badly "Class#subclasses returns a list of classes directly inheriting from self" # GC/Spec order issue. Expected [#<Class:0x2e77c>, #<Class:0x2e79a>, #<Class:0x37368>, ModuleSpecs::Child, ModuleSpecs::Child2] == [ModuleSpecs::Child, ModuleSpecs::Child2] to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/string.rb
spec/filters/bugs/string.rb
# NOTE: run bin/format-filters after changing this file opal_filter "String" do fails "String#% %c raises error when a codepoint isn't representable in an encoding of a format string" # Expected RangeError (/out of char range/) but no exception was raised ("Ԇ" was returned) fails "String#% %c uses the encoding of the format string to interpret codepoints" # ArgumentError: unknown encoding name - euc-jp fails "String#% can produce a string with invalid encoding" # Expected true to be false fails "String#% flags # applies to format o does nothing for negative argument" # Expected "0..7651" == "..7651" to be truthy but was false fails "String#% flags # applies to formats aAeEfgG changes format from dd.dddd to exponential form for gG" # Expected "1.234e+02" == "1.e+02" to be truthy but was false fails "String#% flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% flags (digit)$ specifies the absolute argument number for this field" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% flags * left-justifies the result if specified with $ argument is negative" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "String#% flags * left-justifies the result if width is negative" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "String#% flags * raises ArgumentError when is mixed with width" # Expected ArgumentError but no exception was raised (" 112" was returned) fails "String#% flags * uses the previous argument as the field width" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "String#% flags * uses the specified argument as the width if * is followed by a number and $" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "String#% flags + applies to numeric formats bBdiouxXaAeEfgG adds a leading plus sign to non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% flags - left-justifies the result of conversion if width is specified" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "String#% flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified pads with zeros, not spaces" # Expected "0000000001.095200e+02" == "000000001.095200e+02" to be truthy but was false fails "String#% flags space applies to numeric formats bBdiouxXeEfgGaA does not leave a space at the start of negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% flags space applies to numeric formats bBdiouxXeEfgGaA leaves a space at the start of non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% flags space applies to numeric formats bBdiouxXeEfgGaA treats several white spaces as one" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats A converts floating point argument as [-]0xh.hhhhp[+-]dd and use uppercase X and P" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats A displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats A displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats G otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" == "12.1234" to be truthy but was false fails "String#% float formats G otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" == "1.12346" to be truthy but was false fails "String#% float formats G otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" == "1.55556" to be truthy but was false fails "String#% float formats G the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567E+06" == "1.23457E+06" to be truthy but was false fails "String#% float formats a converts floating point argument as [-]0xh.hhhhp[+-]dd" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats a displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats a displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% float formats g otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" == "12.1234" to be truthy but was false fails "String#% float formats g otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" == "1.12346" to be truthy but was false fails "String#% float formats g otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" == "1.55556" to be truthy but was false fails "String#% float formats g the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567e+06" == "1.23457e+06" to be truthy but was false fails "String#% integer formats d works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "String#% integer formats i works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "String#% integer formats u works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "String#% other formats % alone raises an ArgumentError" # Expected ArgumentError but no exception was raised ("%" was returned) fails "String#% other formats c raises TypeError if argument is nil" # Expected TypeError (/no implicit conversion from nil to integer/) but got: TypeError (no implicit conversion of NilClass into Integer) fails "String#% other formats c raises TypeError if argument is not String or Integer and cannot be converted to them" # Expected TypeError (/no implicit conversion of Array into Integer/) but got: ArgumentError (too few arguments) fails "String#% other formats c raises TypeError if converting to Integer with to_int returns non-Integer" # Expected TypeError (/can't convert BasicObject to String/) but got: NoMethodError (undefined method `respond_to?' for #<BasicObject:0x7300>) fails "String#% other formats c raises TypeError if converting to String with to_str returns non-String" # Expected TypeError (/can't convert BasicObject to String/) but got: NoMethodError (undefined method `respond_to?' for #<BasicObject:0x7328>) fails "String#% other formats c tries to convert argument to Integer with to_int" # NoMethodError: undefined method `respond_to?' for #<BasicObject:0x7324> fails "String#% other formats c tries to convert argument to String with to_str" # NoMethodError: undefined method `respond_to?' for #<BasicObject:0x7318> fails "String#% other formats s preserves encoding of the format string" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#% output's encoding is the same as the format string if passed value is encoding-compatible" # NameError: uninitialized constant Encoding::SHIFT_JIS fails "String#% output's encoding raises if a compatible encoding can't be found" # Expected CompatibilityError but no exception was raised ("hello world" was returned) fails "String#% precision float types controls the number of decimal places displayed in fraction part" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "String#% precision float types does not affect G format" # Expected "12.12340000" == "12.1234" to be truthy but was false fails "String#% precision string formats determines the maximum number of characters to be copied from the string" # Expected "1" == "[" to be truthy but was false fails "String#% raises Encoding::CompatibilityError if both encodings are ASCII compatible and there are not ASCII characters" # ArgumentError: unknown encoding name - windows-1252 fails "String#% raises an error if single % appears at the end" # Expected ArgumentError but no exception was raised ("%" was returned) fails "String#% returns a String in the same encoding as the format String if compatible" # NameError: uninitialized constant Encoding::KOI8_U fails "String#% supports inspect formats using %p" # Expected "{\"capture\"=>1}" == "{:capture=>1}" to be truthy but was false fails "String#% width specifies the minimum number of characters that will be written to the result" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "String#* raises a RangeError when given integer is a Bignum" # Expected RangeError but no exception was raised ("" was returned) fails "String#+ when self and the argument are in different ASCII-compatible encodings raises Encoding::CompatibilityError if neither are ASCII-only" # Expected CompatibilityError but no exception was raised ("éé" was returned) fails "String#+ when self and the argument are in different ASCII-compatible encodings uses the argument's encoding if self is ASCII-only" # Expected #<Encoding:UTF-8> == #<Encoding:ISO-8859-1> to be truthy but was false fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding raises Encoding::CompatibilityError if neither are empty" # Expected CompatibilityError but no exception was raised ("xy" was returned) fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding raises Encoding::CompatibilityError if neither are empty" # Expected CompatibilityError but no exception was raised ("xy" was returned) fails "String#-@ does not deduplicate a frozen string when it has instance variables" # Exception: Cannot create property 'a' on string 'this string is frozen' fails "String#-@ returns the same object for equal unfrozen strings" # Expected "this is a string" not to be identical to "this is a string" fails "String#<< raises a NoMethodError if the given argument raises a NoMethodError during type coercion to a String" # Expected NoMethodError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< when self is BINARY and argument is US-ASCII uses BINARY encoding" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< with Integer returns a BINARY string if self is US-ASCII and the argument is between 128-255 (inclusive)" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<=> with String compares the indices of the encodings when the strings have identical non-ASCII-compatible bytes" # Expected 0 == -1 to be truthy but was false fails "String#== considers encoding compatibility" # Expected true to be false fails "String#== considers encoding difference of incompatible string" # Expected true to be false fails "String#=== considers encoding compatibility" # Expected true to be false fails "String#=== considers encoding difference of incompatible string" # Expected true to be false fails "String#byteindex raises on type errors raises a TypeError if passed a Symbol" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `byteindex' for "hello") fails "String#byteindex with Regexp supports \\G which matches at the given start offset" # NoMethodError: undefined method `byteindex' for "helloYOU." fails "String#byteindex with String raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#byteindex with multibyte codepoints raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#byterindex with object raises on type errors raises a TypeError if passed a Symbol" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `byterindex' for "hello") fails "String#byterindex with object with multibyte codepoints raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#bytesplice mutates self" # NoMethodError: undefined method `bytesplice' for "hello" fails "String#bytesplice raises IndexError for negative length" # Expected IndexError (negative length -2) but got: NoMethodError (undefined method `bytesplice' for "abc") fails "String#bytesplice raises IndexError when index is greater than bytesize" # Expected IndexError (index 6 out of string) but got: NoMethodError (undefined method `bytesplice' for "hello") fails "String#bytesplice raises IndexError when index is less than -bytesize" # Expected IndexError (index -6 out of string) but got: NoMethodError (undefined method `bytesplice' for "hello") fails "String#bytesplice raises RangeError when range left boundary is less than -bytesize" # Expected RangeError (-6...-6 out of range) but got: NoMethodError (undefined method `bytesplice' for "hello") fails "String#bytesplice raises TypeError when integer index is provided without length argument" # Expected TypeError (wrong argument type Integer (expected Range)) but got: NoMethodError (undefined method `bytesplice' for "hello") fails "String#bytesplice raises when string is frozen" # Expected FrozenError (can't modify frozen String: "hello") but got: NoMethodError (undefined method `bytesplice' for "hello") fails "String#bytesplice replaces on an empty string" # NoMethodError: undefined method `bytesplice' for "" fails "String#bytesplice replaces with integer indices" # NoMethodError: undefined method `bytesplice' for "hello" fails "String#bytesplice replaces with ranges" # NoMethodError: undefined method `bytesplice' for "hello" fails "String#bytesplice with multibyte characters deals with a different encoded argument" # NoMethodError: undefined method `bytesplice' for "こんにちは" fails "String#bytesplice with multibyte characters raises IndexError when index is not on a codepoint boundary" # Expected IndexError (offset 1 does not land on character boundary) but got: NoMethodError (undefined method `bytesplice' for "こんにちは") fails "String#bytesplice with multibyte characters raises IndexError when index is out of byte size boundary" # Expected IndexError (index -16 out of string) but got: NoMethodError (undefined method `bytesplice' for "こんにちは") fails "String#bytesplice with multibyte characters raises IndexError when length is not matching the codepoint boundary" # Expected IndexError (offset 1 does not land on character boundary) but got: NoMethodError (undefined method `bytesplice' for "こんにちは") fails "String#bytesplice with multibyte characters raises when ranges not match codepoint boundaries" # Expected IndexError (offset 1 does not land on character boundary) but got: NoMethodError (undefined method `bytesplice' for "こんにちは") fails "String#bytesplice with multibyte characters replaces with integer indices" # NoMethodError: undefined method `bytesplice' for "こんにちは" fails "String#bytesplice with multibyte characters replaces with range" # NoMethodError: undefined method `bytesplice' for "こんにちは" fails "String#bytesplice with multibyte characters treats negative length for range as 0" # NoMethodError: undefined method `bytesplice' for "こんにちは" fails "String#capitalize full Unicode case mapping adapted for Lithuanian allows Turkic as an extra option (and applies Turkic semantics)" # ArgumentError: [String#capitalize] wrong number of arguments (given 2, expected 0) fails "String#capitalize full Unicode case mapping adapted for Lithuanian currently works the same as full Unicode case mapping" # ArgumentError: [String#capitalize] wrong number of arguments (given 1, expected 0) fails "String#capitalize full Unicode case mapping adapted for Turkic languages allows Lithuanian as an extra option" # ArgumentError: [String#capitalize] wrong number of arguments (given 2, expected 0) fails "String#capitalize full Unicode case mapping adapted for Turkic languages capitalizes ASCII characters according to Turkic semantics" # ArgumentError: [String#capitalize] wrong number of arguments (given 1, expected 0) 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.) fails "String#casecmp independent of case returns nil if incompatible encodings" # NameError: uninitialized constant Encoding::EUC_JP fails "String#casecmp? independent of case returns nil if incompatible encodings" # NameError: uninitialized constant Encoding::EUC_JP fails "String#chomp when passed no argument returns a copy of the String when it is not modified" # Expected "abc" not to be identical to "abc" 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.) 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.) 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.) 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.) 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.) fails "String#clone calls #initialize_copy on the new instance" # Expected nil == "string" to be truthy but was false fails "String#clone copies singleton methods" # TypeError: can't define singleton fails "String#concat raises a NoMethodError if the given argument raises a NoMethodError during type coercion to a String" # Mock 'world!' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#concat when self is BINARY and argument is US-ASCII uses BINARY encoding" # NoMethodError: undefined method `concat' for "abc" fails "String#concat with Integer returns a BINARY string if self is US-ASCII and the argument is between 128-255 (inclusive)" # NoMethodError: undefined method `concat' for "" fails "String#delete! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete!' for "hello") fails "String#delete_prefix! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete_prefix!' for "hello") fails "String#delete_suffix! raises a FrozenError when self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `delete_suffix!' for "hello") fails "String#downcase full Unicode case mapping adapted for Lithuanian allows Turkic as an extra option (and applies Turkic semantics)" # ArgumentError: [String#downcase] wrong number of arguments (given 2, expected 0) fails "String#downcase full Unicode case mapping adapted for Lithuanian currently works the same as full Unicode case mapping" # ArgumentError: [String#downcase] wrong number of arguments (given 1, expected 0) fails "String#downcase full Unicode case mapping adapted for Turkic languages allows Lithuanian as an extra option" # ArgumentError: [String#downcase] wrong number of arguments (given 2, expected 0) fails "String#downcase full Unicode case mapping adapted for Turkic languages downcases characters according to Turkic semantics" # ArgumentError: [String#downcase] wrong number of arguments (given 1, expected 0) 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.) fails "String#dump includes .force_encoding(name) if the encoding isn't ASCII compatible" # NoMethodError: undefined method `dump' for "ࡶ" fails "String#dump returns a String in the same encoding as self" # NoMethodError: undefined method `dump' for "foo" fails "String#dup calls #initialize_copy on the new instance" # Expected nil == "string" to be truthy but was false fails "String#dup does not modify the original setbyte-mutated string when changing dupped string" # NoMethodError: undefined method `setbyte' for "a" fails "String#each_byte keeps iterating from the old position (to new string end) when self changes" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#each_grapheme_cluster returns a different character if the String is transcoded" # NoMethodError: undefined method `each_grapheme_cluster' for "€" fails "String#each_grapheme_cluster uses the String's encoding to determine what characters it contains" # NoMethodError: undefined method `each_grapheme_cluster' for "𤭢" fails "String#encode when passed options replace multiple invalid bytes at the end with a single replacement character" # NoMethodError: undefined method `default_internal' for Encoding fails "String#encode when passed to, from, options returns a copy in the destination encoding when both encodings are the same" # NoMethodError: undefined method `default_internal' for Encoding 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 fails "String#encode! raises a FrozenError when called on a frozen String" # NoMethodError: undefined method `default_internal' for Encoding fails "String#encoding for Strings with \\x escapes returns BINARY when an escape creates a byte with the 8th bit set if the source encoding is US-ASCII" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#end_with? checks that we are starting to match at the head of a character" # Expected "ab".end_with? "b" to be falsy but was true fails "String#end_with? raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#eql? considers encoding compatibility" # Expected true to be false fails "String#eql? considers encoding difference of incompatible string" # Expected true to be false fails "String#force_encoding raises a FrozenError if self is frozen" # Expected FrozenError but no exception was raised ("abcd" was returned) fails "String#force_encoding with a special encoding name accepts valid special encoding names" # NoMethodError: undefined method `default_internal' for Encoding fails "String#force_encoding with a special encoding name defaults to BINARY if special encoding name is not set" # NoMethodError: undefined method `default_internal' for Encoding 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" fails "String#grapheme_clusters returns a different character if the String is transcoded" # NoMethodError: undefined method `grapheme_clusters' for "€" fails "String#grapheme_clusters uses the String's encoding to determine what characters it contains" # NoMethodError: undefined method `grapheme_clusters' for "𤭢" fails "String#gsub with pattern and block does not set $~ for procs created from methods" # Expected "he<l><l>o" == "he<unset><unset>o" to be truthy but was false fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible" # Expected CompatibilityError but got: ArgumentError (unknown encoding name - iso-8859-5) fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible" # ArgumentError: unknown encoding name - iso-8859-5 fails "String#gsub with pattern and block uses the compatible encoding if they are compatible" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false fails "String#gsub with pattern and replacement doesn't freak out when replacing ^" # Expected " Text " == " Text " to be truthy but was false fails "String#gsub with pattern and replacement handles a pattern in a superset encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#gsub with pattern and replacement replaces \\k named backreferences with the regexp's corresponding capture" # Expected "h<\\k<foo>>ll<\\k<foo>>" == "h<e>ll<o>" to be truthy but was false fails "String#gsub with pattern and replacement supports \\G which matches at the beginning of the remaining (non-matched) string" # Expected "hello homely world. hah!" == "huh? huh? world. hah!" to be truthy but was false 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.) 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.) fails "String#include? with String raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#initialize with no arguments does not raise an exception when frozen" # Expected nil to be identical to "hello" fails "String#insert with index, other raises a FrozenError if self is frozen" # Expected FrozenError but got: NoMethodError (undefined method `insert' for "abcd") fails "String#insert with index, other should not call subclassed string methods" # NoMethodError: undefined method `insert' for "abcd" fails "String#inspect when the string's encoding is different than the result's encoding and the string has both ASCII-compatible and ASCII-incompatible chars returns a string with the non-ASCII characters replaced by \\u notation" # Expected "\"hello привет\"" == "\"hello \\u043F\\u0440\\u0438\\u0432\\u0435\\u0442\"" to be truthy but was false fails "String#inspect when the string's encoding is different than the result's encoding and the string's encoding is ASCII-compatible but the characters are non-ASCII returns a string with the non-ASCII characters replaced by \\x notation" # ArgumentError: unknown encoding name - EUC-JP fails "String#inspect works for broken US-ASCII strings" # Expected "\"©\"" == "\"\\xC2\\xA9\"" to be truthy but was false fails "String#intern ignores existing symbols with different encoding" # Expected #<Encoding:UTF-8> == #<Encoding:ISO-8859-1> to be truthy but was false fails "String#intern raises an EncodingError for UTF-8 String containing invalid bytes" # Expected "Ã".valid_encoding? to be falsy but was true fails "String#intern returns a US-ASCII Symbol for a UTF-8 String containing only US-ASCII characters" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#intern returns a US-ASCII Symbol for a binary String containing only US-ASCII characters" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#intern returns a UTF-16LE Symbol for a UTF-16LE String containing non US-ASCII characters" # Expected #<Encoding:UTF-8> == #<Encoding:UTF-16LE> to be truthy but was false fails "String#intern returns a binary Symbol for a binary String containing non US-ASCII characters" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false fails "String#length adds 1 (and not 2) for a incomplete surrogate in UTF-16" # Expected 2 == 1 to be truthy but was false fails "String#length adds 1 for a broken sequence in UTF-32" # Expected 4 == 1 to be truthy but was false fails "String#length returns the correct length after force_encoding(BINARY)" # Expected 2 == 4 to be truthy but was false fails "String#ljust with length, padding with width, pattern returns a String in the compatible encoding" # Expected #<Encoding:IBM437 (dummy)> to be identical to #<Encoding:UTF-8> fails "String#lstrip returns a String in the same encoding as self" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false 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.) 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.) fails "String#ord raises ArgumentError if the character is broken" # Expected ArgumentError (invalid byte sequence in US-ASCII) but no exception was raised (169 was returned) fails "String#partition with String handles a pattern in a superset encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#partition with String returns String instances when called on a subclass" # Expected "hello" (StringSpecs::MyString) to be an instance of String 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.) 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.) 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.) fails "String#rindex with String raises an Encoding::CompatibilityError if the encodings are incompatible" # ArgumentError: unknown encoding name - ISO-2022-JP fails "String#rjust with length, padding with width, pattern returns a String in the compatible encoding" # Expected #<Encoding:IBM437 (dummy)> to be identical to #<Encoding:UTF-8> fails "String#rpartition with String handles a pattern in a superset encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "String#rpartition with String returns String instances when called on a subclass" # Expected "hello" (StringSpecs::MyString) to be an instance of String fails "String#rpartition with String returns new object if doesn't match" # Expected "hello".equal? "hello" to be falsy but was true fails "String#rstrip! raises a FrozenError on a frozen instance that is modified" # Expected FrozenError but got: NoMethodError (undefined method `rstrip!' for " hello ") 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") fails "String#rstrip! raises an Encoding::CompatibilityError if the last non-space codepoint is invalid" # Expected true to be false fails "String#scrub with a block replaces invalid byte sequences using a custom encoding" # Expected "\uFFFD\uFFFD" == "€€" to be truthy but was false
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
true
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/ruby-32.rb
spec/filters/bugs/ruby-32.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Ruby 3.2" do fails "A block yielded a single Array does not autosplat single argument to required arguments when a keyword rest argument is present" # ArgumentError: expected kwargs fails "Fixnum is no longer defined" # Expected Object.const_defined? "Fixnum" to be falsy but was true fails "Kernel#=~ is no longer defined" # Expected #<Object:0x11214>.respond_to? "=~" to be falsy but was true fails "Kernel#sprintf other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character fails "Kernel#sprintf other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character fails "Kernel.printf formatting io is not specified other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character fails "Kernel.printf formatting io is not specified other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character fails "Kernel.printf formatting io is specified other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character fails "Kernel.printf formatting io is specified other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character fails "Kernel.sprintf other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character fails "Kernel.sprintf other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character fails "Keyword arguments delegation does not work with call(*ruby2_keyword_args) with missing ruby2_keywords in between" # Expected [[], {}] == [[{}], {}] to be truthy but was false fails "Method#owner returns the class on which public was called for a private method in ancestor" # Expected MethodSpecs::InheritedMethods::B == MethodSpecs::InheritedMethods::C to be truthy but was false fails "Method#parameters adds * rest arg for \"star\" argument" # Expected [["rest"]] == [["rest", "*"]] to be truthy but was false fails "Module#const_added is a private instance method" # Expected Module to have private instance method 'const_added' but it does not fails "Module#const_added is called with a precise caller location with the line of definition" # Expected [] == [111, 113, 116, 120] to be truthy but was false fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (*args)" # Expected false == true to be truthy but was false fails "Proc#parameters adds * rest arg for \"star\" argument" # Expected [["req", "x"], ["rest"]] == [["req", "x"], ["rest", "*"]] to be truthy but was false fails "Random::DEFAULT is no longer defined" # Expected Random.const_defined? "DEFAULT" to be falsy but was true fails "Refinement#append_features is not called by Module#include" # Expected TypeError but no exception was raised (#<Class:0x2e61c> was returned) fails "Refinement#extend_object is not called by Object#extend" # Expected TypeError but no exception was raised (#<Class:0x28fcc> was returned) fails "Refinement#prepend_features is not called by Module#prepend" # Expected TypeError but no exception was raised (#<Class:0x70cf6> was returned) fails "Regexp.compile given a String accepts a String of supported flags as the second argument" # Expected 0 == 0 to be falsy but was true fails "Regexp.compile given a String raises an Argument error if the second argument contains unsupported chars" # Expected ArgumentError but no exception was raised (/Hi/i was returned) fails "Regexp.compile given a String warns any non-Integer, non-nil, non-false second argument" # Expected warning to match: /expected true or false as ignorecase/ but got: "" fails "Regexp.new given a String accepts a String of supported flags as the second argument" # Expected 0 == 0 to be falsy but was true fails "Regexp.new given a String raises an Argument error if the second argument contains unsupported chars" # Expected ArgumentError but no exception was raised (/Hi/i was returned) fails "Regexp.new given a String warns any non-Integer, non-nil, non-false second argument" # Expected warning to match: /expected true or false as ignorecase/ but got: "" fails "Regexp.timeout raises Regexp::TimeoutError after global timeout elapsed" # NoMethodError: undefined method `timeout=' for Regexp fails "Regexp.timeout raises Regexp::TimeoutError after timeout keyword value elapsed" # NoMethodError: undefined method `timeout=' for Regexp fails "Regexp.timeout returns global timeout" # NoMethodError: undefined method `timeout=' for Regexp fails "String#% other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character fails "String#% other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character fails "String#% supports only the first character as argument for %c" # ArgumentError: %c requires a character fails "String#dedup deduplicates frozen strings" # Expected "this string is frozen" not to be identical to "this string is frozen" fails "String#dedup does not deduplicate a frozen string when it has instance variables" # Exception: Cannot create property 'a' on string 'this string is frozen' fails "String#dedup interns the provided string if it is frozen" # NoMethodError: undefined method `dedup' for "this string is unique and frozen 0.698166086070234" fails "String#dedup returns a frozen copy if the String is not frozen" # NoMethodError: undefined method `dedup' for "foo" fails "String#dedup returns self if the String is frozen" # NoMethodError: undefined method `dedup' for "foo" fails "String#dedup returns the same object for equal unfrozen strings" # Expected "this is a string" not to be identical to "this is a string" fails "String#dedup returns the same object when it's called on the same String literal" # NoMethodError: undefined method `dedup' for "unfrozen string" fails "Struct.new on subclasses accepts keyword arguments to initialize" # Expected #<struct args={"args"=>42}> == #<struct args=42> to be truthy but was false fails "Struct.new raises a TypeError if passed a Hash with an unknown key" # Expected TypeError but no exception was raised (#<Class:0x356> was returned) fails "Symbol#to_proc only calls public methods" # Expected NoMethodError (/protected method `pro' called/) but no exception was raised (#<MSpecEnv:0x146c8 @a=["pub", "pro"]> was returned) fails "The module keyword does not reopen a module included in Object" # Expected ModuleSpecs::IncludedInObject::IncludedModuleSpecs == ModuleSpecs::IncludedInObject::IncludedModuleSpecs to be falsy but was true fails "UnboundMethod#owner returns the class on which public was called for a private method in ancestor" # Expected MethodSpecs::InheritedMethods::B == MethodSpecs::InheritedMethods::C to be truthy but was false fails "main.using does not raise error when wrapped with module" # Expected to not get Exception but got: ArgumentError ([MSpecEnv#load] wrong number of arguments (given 2, expected 1)) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/complex.rb
spec/filters/bugs/complex.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Complex" do 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 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) 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 fails "Complex#inspect calls #inspect on real and imaginary" # ArgumentError: comparison of NumericSpecs::Subclass with 0 failed fails "Complex#to_c returns self" # Expected ((1+5i)+0i) to be identical to (1+5i) fails "Complex#to_c returns the same value" # Expected ((1+5i)+0i) == (1+5i) to be truthy but was false fails "Complex#to_s treats real and imaginary parts as strings" # ArgumentError: comparison of NumericSpecs::Subclass with 0 failed fails "Complex.polar computes the real values of the real & imaginary parts from the polar form" # TypeError: not a real end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/trace_point.rb
spec/filters/bugs/trace_point.rb
# NOTE: run bin/format-filters after changing this file opal_filter "TracePoint" do fails "TracePoint#inspect returns a String showing the event and thread for :thread_begin event" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a String showing the event and thread for :thread_end event" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a String showing the event, method, path and line for a :c_call event" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a String showing the event, method, path and line for a :call event" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a String showing the event, method, path and line for a :return event" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a String showing the event, path and line for a :class event" # Expected "#<TracePoint:0x89c86 @event=\"class\" @block=#<Proc:0x89c88> @trace_object=TracePointSpec::C @trace_evt=\"trace_class\" @tracers_for_evt=\"tracers_for_class\">" == "#<TracePoint:class ruby/core/tracepoint/inspect_spec.rb:87>" to be truthy but was false fails "TracePoint#inspect returns a String showing the event, path and line" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect returns a string containing a human-readable TracePoint status" # RuntimeError: Only the :class event is supported fails "TracePoint#inspect shows only whether it's enabled when outside the TracePoint handler" # RuntimeError: Only the :class event is supported fails "TracePoint#self return the trace object from event" # RuntimeError: Only the :class event is supported end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/random.rb
spec/filters/bugs/random.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Random" do fails "Random#bytes returns the same numeric output for a given huge seed across all implementations and platforms" # Expected "àË" == "_\x91" to be truthy but was false fails "Random#bytes returns the same numeric output for a given seed across all implementations and platforms" # Expected "ç\x16" == "\x14\\" to be truthy but was false fails "Random#rand with Range returns a float within a given float range" # Expected 51 == 37.454011884736246 to be truthy but was false fails "Random#rand with Range supports custom object types" # Expected "NaN#<struct RandomSpecs::CustomRangeInteger value=1>" (String) to be an instance of RandomSpecs::CustomRangeInteger fails "SecureRandom.random_number generates a random float number between 0.0 and 1.0 if argument is negative float" # ArgumentError: invalid argument - -11.1 fails "SecureRandom.random_number generates a random float number between 0.0 and 1.0 if argument is negative" # ArgumentError: invalid argument - -10 fails "SecureRandom.random_number raises ArgumentError if the argument is non-numeric" # Expected ArgumentError but got: TypeError (no implicit conversion of Object into Integer) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/enumerable.rb
spec/filters/bugs/enumerable.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Enumerable" do 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: "" 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: "" fails "Enumerable#chain returns a chain of self and provided enumerables" # NoMethodError: undefined method `chain' for #<EnumerableSpecs::Numerous:0x2eb8 @list=[1]> 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]> fails "Enumerable#chunk returns a partitioned Array of values" # NoMethodError: undefined method `last' for false 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 fails "Enumerable#collect reports the same arity as the given block" # Exception: Cannot read properties of undefined (reading '$$is_array') fails "Enumerable#collect yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments (given 1, expected 2) fails "Enumerable#first returns a gathered array from yield parameters" # Expected 1 == [1, 2] to be truthy but was false fails "Enumerable#grep correctly handles non-string elements" # Expected nil == "match" to be truthy but was false fails "Enumerable#grep does not modify Regexp.last_match without block" # NoMethodError: undefined method `[]' for nil fails "Enumerable#grep does not set $~ when given no block" # Expected nil == "z" to be truthy but was false fails "Enumerable#grep_v correctly handles non-string elements" # Expected nil == "match" to be truthy but was false fails "Enumerable#grep_v does not modify Regexp.last_match without block" # Expected "e" == "z" to be truthy but was false fails "Enumerable#grep_v does not set $~ when given no block" # Expected "e" == "z" to be truthy but was false 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: "" 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')) fails "Enumerable#map reports the same arity as the given block" # Exception: Cannot read properties of undefined (reading '$$is_array') fails "Enumerable#map yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments (given 1, expected 2) 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: "" 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: "" 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: "" 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')) 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 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 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 fails "Enumerable#sort_by calls #each to iterate over the elements to be sorted" # Mock '#<EnumerableSpecs::Numerous:0x42a10 @list=[1, 2, 3]>' expected to receive each("any_args") exactly 1 times but received it 0 times 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>> 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 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 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> fails "Enumerable#uniq uses eql? semantics" # Expected [1] == [1, 1] to be truthy but was false 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 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>) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/pathname.rb
spec/filters/bugs/pathname.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Pathname" do fails "Pathname#/ appends a pathname to self" # NoMethodError: undefined method `/' for #<Pathname:0xb5bd8 @path="/usr"> fails "Pathname#inspect returns a consistent String" # Expected "#<Pathname:0x1e50 @path=\"/tmp\">" == "#<Pathname:/tmp>" to be truthy but was false fails "Pathname#realdirpath returns a Pathname" # NoMethodError: undefined method `realdirpath' for #<Pathname:0x1380 @path="."> fails "Pathname#realpath returns a Pathname" # NoMethodError: undefined method `realpath' for #<Pathname:0xaa902 @path="."> fails "Pathname#relative_path_from converts string argument to Pathname" # NoMethodError: undefined method `cleanpath' for "/usr" fails "Pathname#relative_path_from raises an error when the base directory has .." # Expected ArgumentError but no exception was raised ("a" was returned) fails "Pathname#relative_path_from raises an error when the two paths do not share a common prefix" # Expected ArgumentError but no exception was raised ("../usr" was returned) fails "Pathname#relative_path_from returns current and pattern when only those patterns are used" # Expected "." == ".." to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/nilclass.rb
spec/filters/bugs/nilclass.rb
# NOTE: run bin/format-filters after changing this file opal_filter "NilClass" do fails "NilClass#=~ returns nil matching any object" # Expected false to be nil end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/integer.rb
spec/filters/bugs/integer.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Integer" do fails "Integer is the class of both small and large integers" # Expected Number to be identical to Integer fails "Integer#& fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned) 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: "" fails "Integer#** fixnum raises a ZeroDivisionError for 0 ** -1" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Integer#** fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: "" fails "Integer#** fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded fails "Integer#+ can be redefined" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x41850 @method="+" @object=nil> fails "Integer#/ fixnum coerces fixnum and return self divided by other" # Expected 5.421010862427522e-20 == 0 to be truthy but was false fails "Integer#/ fixnum raises a ZeroDivisionError if the given argument is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Integer#/ fixnum returns result the same class as the argument" # Expected 1.5 == 1 to be truthy but was false fails "Integer#/ fixnum returns self divided by the given argument" # Expected 1.5 == 1 to be truthy but was false fails "Integer#/ fixnum supports dividing negative numbers" # Expected -0.1 == -1 to be truthy but was false 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 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 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 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) 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 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 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 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 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 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) 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 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 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) fails "Integer#[] fixnum when index and length passed ignores negative length" # ArgumentError: [Number#[]] wrong number of arguments (given 2, expected 1) fails "Integer#[] fixnum when index and length passed moves start position to the most significant bits when negative index passed" # ArgumentError: [Number#[]] wrong number of arguments (given 2, expected 1) fails "Integer#[] fixnum when index and length passed returns specified number of bits from specified position" # ArgumentError: [Number#[]] wrong number of arguments (given 2, expected 1) fails "Integer#[] fixnum when range passed ensures n[i..] equals to (n >> i)" # TypeError: no implicit conversion of Range into Integer fails "Integer#[] fixnum when range passed ensures n[i..j] equals to (n >> i) & ((1 << (j - i + 1)) - 1)" # TypeError: no implicit conversion of Range into Integer fails "Integer#[] fixnum when range passed ignores upper boundary smaller than lower boundary" # TypeError: no implicit conversion of Range into Integer fails "Integer#[] fixnum when range passed moves lower boundary to the most significant bits when negative value passed" # ArgumentError: [Number#[]] wrong number of arguments (given 2, expected 1) fails "Integer#[] fixnum when range passed raises FloatDomainError if any boundary is infinity" # Expected FloatDomainError (/Infinity/) but got: TypeError (no implicit conversion of Range into Integer) fails "Integer#[] fixnum when range passed returns bits specified by range" # TypeError: no implicit conversion of Range into Integer fails "Integer#[] fixnum when range passed when passed (..i) raises ArgumentError if any of i bit equals 1" # Expected ArgumentError (/The beginless range for Integer#\[\] results in infinity/) but got: TypeError (no implicit conversion of Range into Integer) fails "Integer#[] fixnum when range passed when passed (..i) returns 0 if all i bits equal 0" # TypeError: no implicit conversion of Range into Integer fails "Integer#^ fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (0 was returned) fails "Integer#^ fixnum returns self bitwise EXCLUSIVE OR other" # Expected 5 == 18446744078004520000 to be truthy but was false fails "Integer#^ fixnum returns self bitwise XOR other when one operand is negative" # Expected -3 == -8589934593 to be truthy but was false fails "Integer#ceildiv returns a quotient of division which is rounded up to the nearest integer" # NoMethodError: undefined method `ceildiv' for 0 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) fails "Integer#chr with an encoding argument raises a RangeError if self is too large" # Expected RangeError but no exception was raised ("膀" was returned) fails "Integer#chr with an encoding argument raises a RangeError is self is less than 0" # Expected RangeError but no exception was raised ("\uFFFF" was returned) fails "Integer#chr with an encoding argument returns a String encoding self interpreted as a codepoint in the CESU-8 encoding" # NameError: uninitialized constant Encoding::CESU_8 fails "Integer#chr with an encoding argument returns a String encoding self interpreted as a codepoint in the specified encoding" # NameError: uninitialized constant Encoding::SHIFT_JIS fails "Integer#chr with an encoding argument returns a new String for each call" # Expected " " not to be identical to " " fails "Integer#chr without argument raises a RangeError if self is too large" # Expected RangeError but no exception was raised ("膀" was returned) fails "Integer#chr without argument raises a RangeError is self is less than 0" # Expected RangeError but no exception was raised ("\uFFFF" was returned) fails "Integer#chr without argument returns a new String for each call" # Expected "R" not to be identical to "R" fails "Integer#chr without argument when Encoding.default_internal is nil and self is between 0 and 127 (inclusive) returns a US-ASCII String" # Expected #<Encoding:ASCII-8BIT> == #<Encoding:US-ASCII> to be truthy but was false fails "Integer#chr without argument when Encoding.default_internal is nil raises a RangeError is self is greater than 255" # Expected RangeError but no exception was raised ("Ā" was returned) fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 0 and 127 (inclusive) returns a US-ASCII String" # NoMethodError: undefined method `default_internal' for Encoding fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 raises RangeError if self is invalid as a codepoint in the default internal encoding" # NoMethodError: undefined method `default_internal' for Encoding fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 returns a String encoding self interpreted as a codepoint in the default internal encoding" # NoMethodError: undefined method `default_internal' for Encoding fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 returns a String with the default internal encoding" # NoMethodError: undefined method `default_internal' for Encoding fails "Integer#coerce bigdecimal produces Floats" # Expected Number == Float to be truthy but was false fails "Integer#coerce fixnum raises a TypeError when given an Object that does not respond to #to_f" # Expected TypeError but got: ArgumentError (invalid value for Float(): "test") fails "Integer#coerce fixnum when given a Fixnum returns an array containing two Fixnums" # Expected [Number, Number] == [Integer, Integer] to be truthy but was false fails "Integer#div fixnum calls #coerce and #div if argument responds to #coerce" # Mock 'x' expected to receive div(#<MockObject:0x22a30 @name="y" @null=nil>) exactly 1 times but received it 0 times fails "Integer#divmod fixnum raises a TypeError when given a non-Integer" # Expected TypeError but got: NoMethodError (undefined method `nan?' for #<MockObject:0x270c8 @name="10" @null=nil>) fails "Integer#fdiv performs floating-point division between self bignum and a bignum" # Expected NaN == 500 to be truthy but was false fails "Integer#fdiv rounds to the correct float for bignum denominators" # Expected 0 == 1e-323 to be truthy but was false fails "Integer#fdiv rounds to the correct value for bignums" # Expected NaN == 11.11111111111111 to be truthy but was false fails "Integer#odd? fixnum returns true when self is an odd number" # Expected false to be true fails "Integer#pow one argument is passed fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: "" fails "Integer#pow one argument is passed fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded fails "Integer#pow two arguments are passed raises a RangeError when the first argument is negative and the second argument is present" # Expected RangeError but got: TypeError (Integer#pow() 1st argument cannot be negative when 2nd argument specified) fails "Integer#round raises ArgumentError for an unknown rounding mode" # Expected ArgumentError (/invalid rounding mode: foo/) but got: ArgumentError ([Number#round] wrong number of arguments (given 2, expected -1)) fails "Integer#round returns different rounded values depending on the half option" # ArgumentError: [Number#round] wrong number of arguments (given 2, expected -1) fails "Integer#round returns itself if passed a positive precision and the half option" # ArgumentError: [Number#round] wrong number of arguments (given 2, expected -1) fails "Integer#round returns itself rounded to nearest if passed a negative value" # Expected 0 to have same value and type as 2.9999999999999996e+71 fails "Integer#zero? Integer#zero? overrides Numeric#zero?" # Expected Number == Integer to be truthy but was false fails "Integer#| fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned) fails "Integer#| fixnum returns self bitwise OR other when one operand is negative" # Expected -3 == -8589934593 to be truthy but was false fails "Integer#| fixnum returns self bitwise OR other" # Expected 65535 == 18446744073709617000 to be truthy but was false fails "Integer.sqrt returns the integer square root of the argument" # TypeError: can't convert Number into Integer (Number#to_int gives Number) 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)) 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)) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/datetime.rb
spec/filters/bugs/datetime.rb
# NOTE: run bin/format-filters after changing this file opal_filter "DateTime" do fails "DateTime#+ is able to add sub-millisecond precision values" # Expected 0 == 864864 to be truthy but was false fails "DateTime#- correctly calculates sub-millisecond time differences" # Expected 5097600 == 59.000001 to be truthy but was false fails "DateTime#- is able to subtract sub-millisecond precision values" # Expected 0 == (13717421/9600000000) to be truthy but was false fails "DateTime#hour adds 24 to negative hours" # ArgumentError: hour out of range: -10 fails "DateTime#hour raises an error for Float" # Expected ArgumentError but no exception was raised (1 was returned) fails "DateTime#hour raises an error for Rational" # Expected ArgumentError but no exception was raised (#<DateTime:0xa6cca @date=-4712-01-01 00:00:00 UTC, @start=2299161> was returned) fails "DateTime#second adds 60 to negative values" # ArgumentError: sec out of range: -20 fails "DateTime#second raises an error when minute is given as a rational" # Expected ArgumentError but no exception was raised (#<DateTime:0x4da4 @date=-4712-01-01 00:05:00 UTC, @start=2299161> was returned) fails "DateTime#second raises an error, when the second is greater or equal than 60" # Expected ArgumentError but no exception was raised (#<DateTime:0x4c16 @date=-4712-01-01 00:01:00 UTC, @start=2299161> was returned) fails "DateTime#strftime returns the timezone with %Z" # Expected "UTC" == "-00:00" to be truthy but was false fails "DateTime#strftime should be able to print the commercial year with leading zeroes" # Expected "200" == "0200" to be truthy but was false fails "DateTime#strftime should be able to print the commercial year with only two digits" # TypeError: no implicit conversion of Range into Integer fails "DateTime#strftime should be able to print the datetime with no argument" # Expected "2001-02-03T04:05:06-00:00" == "2001-02-03T04:05:06+00:00" to be truthy but was false 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 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 fails "DateTime#strftime should be able to show the commercial week day" # Expected "1" == "7" to be truthy but was false fails "DateTime#strftime should be able to show the commercial week" # Expected " 3-FEB-2001" == " 3-Feb-2001" to be truthy but was false 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 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 fails "DateTime#strftime should be able to show the timezone with a : separator" # Expected "UTC" == "+00:00" to be truthy but was false fails "DateTime#strftime should be able to show the week number with the week starting on Sunday (%U) and Monday (%W)" # Expected "%U" == "14" to be truthy but was false fails "DateTime#strftime shows the number of milliseconds since epoch" # Expected "%Q" == "0" to be truthy but was false fails "DateTime#strftime with %L formats the milliseconds of the second" # Expected "000" == "100" to be truthy but was false fails "DateTime#strftime with %N formats the microseconds of the second with %6N" # Expected "000000" == "042000" to be truthy but was false fails "DateTime#strftime with %N formats the milliseconds of the second with %3N" # Expected "000" == "050" to be truthy but was false fails "DateTime#strftime with %N formats the nanoseconds of the second with %9N" # Expected "000000000" == "001234000" to be truthy but was false fails "DateTime#strftime with %N formats the nanoseconds of the second with %N" # Expected "000000000" == "001234560" to be truthy but was false fails "DateTime#strftime with %N formats the picoseconds of the second with %12N" # Expected "000000000000" == "999999999999" to be truthy but was false fails "DateTime#strftime with %z formats a UTC time offset as '+0000'" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a local time with negative UTC offset as '-HHMM'" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a local time with positive UTC offset as '+HHMM'" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a time with fixed negative offset as '-HHMM'" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a time with fixed offset as '+/-HH:MM' with ':' specifier" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a time with fixed offset as '+/-HH:MM:SS' with '::' specifier" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#strftime with %z formats a time with fixed positive offset as '+HHMM'" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "DateTime#to_time preserves the same time regardless of local time or zone" # Expected 180 == 10800 to be truthy but was false fails "DateTime.min adds 60 to negative minutes" # ArgumentError: min out of range: -20 fails "DateTime.min raises an error for Float" # Expected ArgumentError but no exception was raised (#<DateTime:0x55fc @date=-4712-01-01 00:05:00 UTC, @start=2299161> was returned) fails "DateTime.min raises an error for Rational" # Expected ArgumentError but no exception was raised (#<DateTime:0x52ea @date=-4712-01-01 00:05:00 UTC, @start=2299161> was returned) fails "DateTime.minute adds 60 to negative minutes" # ArgumentError: min out of range: -20 fails "DateTime.minute raises an error for Float" # Expected ArgumentError but no exception was raised (#<DateTime:0x6922 @date=-4712-01-01 00:05:00 UTC, @start=2299161> was returned) fails "DateTime.minute raises an error for Rational" # Expected ArgumentError but no exception was raised (#<DateTime:0x6618 @date=-4712-01-01 02:00:00 UTC, @start=2299161> was returned) fails "DateTime.new takes the seventh argument as an offset" # Expected 1.3503086419753086e-7 == 0.7 to be truthy but was false fails "DateTime.now grabs the local timezone" # Expected "+01:00" == "-08:00" to be truthy but was false fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format parses YYYY-MM-DDTHH:MM:SS into a DateTime object" # Expected #<DateTime:0x8a68 @date=2012-11-08 15:43:59 +0100, @start=2299161> == #<DateTime:0x8a6c @date=2012-11-08 15:43:59 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format throws an argument error for invalid day values" # Expected ArgumentError but no exception was raised (#<DateTime:0x8d76 @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN, @start=2299161> was returned) fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format throws an argument error for invalid hour values" # Expected ArgumentError but no exception was raised (#<DateTime:0x88ea @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN, @start=2299161> was returned) fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format throws an argument error for invalid minute values" # Expected ArgumentError but no exception was raised (#<DateTime:0x9076 @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN, @start=2299161> was returned) fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format throws an argument error for invalid month values" # Expected ArgumentError but no exception was raised (#<DateTime:0x8ef6 @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN, @start=2299161> was returned) fails "DateTime.parse YYYY-MM-DDTHH:MM:SS format throws an argument error for invalid second values" # Expected ArgumentError but no exception was raised (#<DateTime:0x876a @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN, @start=2299161> was returned) fails "DateTime.parse parses DD as month day number" # Expected #<DateTime:0x8146 @date=2001-10-01 00:00:00 +0200, @start=2299161> == #<DateTime:0x814e @date=2022-12-10 00:00:00 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse parses DDD as year day number" # Expected #<DateTime:0x799e @date=100-01-01 00:00:00 +0124, @start=2299161> == #<DateTime:0x79a6 @date=2022-04-10 00:00:00 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse parses MMDD as month and day" # Expected #<DateTime:0x7cb8 @date=1108-01-01 01:24:00 +0124, @start=2299161> == #<DateTime:0x7cbe @date=2022-11-08 00:00:00 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse parses YYDDD as year and day number in 1969--2068" # Expected #<DateTime:0x7684 @date=10100-01-01 00:00:00 +0100, @start=2299161> == #<DateTime:0x7688 @date=2010-04-10 00:00:00 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse parses YYMMDD as year, month and day in 1969--2068" # Expected #<DateTime:0x8456 @date=201023-01-01 00:00:00 +0100, @start=2299161> == #<DateTime:0x845a @date=2020-10-23 00:00:00 UTC, @start=2299161> to be truthy but was false fails "DateTime.parse parses a day name into a DateTime object" # NoMethodError: undefined method `cwyear' for #<DateTime:0x767c @start=2299161 @date=NaN-NaN-NaN NaN:NaN:NaN -NaNNaN> fails "DateTime.parse throws an argument error for a single digit" # Expected ArgumentError but no exception was raised (#<DateTime:0x7fc8 @date=2001-01-01 00:00:00 +0100, @start=2299161> was returned) fails "DateTime.parse(.) parses DD.MM.YYYY into a DateTime object" # Expected 10 == 1 to be truthy but was false fails "DateTime.parse(.) parses YY.MM.DD into a DateTime object using the year 20YY" # Expected 2007 == 2010 to be truthy but was false fails "DateTime.parse(.) parses YY.MM.DD using the year digits as 20YY when given true as additional argument" # ArgumentError: [DateTime.parse] wrong number of arguments (given 2, expected 1) fails "DateTime.sec adds 60 to negative values" # ArgumentError: sec out of range: -20 fails "DateTime.sec raises an error when minute is given as a rational" # Expected ArgumentError but no exception was raised (#<DateTime:0x3e5a @date=-4712-01-01 00:05:00 UTC, @start=2299161> was returned) fails "DateTime.sec raises an error, when the second is greater or equal than 60" # Expected ArgumentError but no exception was raised (#<DateTime:0x3cbe @date=-4712-01-01 00:01:00 UTC, @start=2299161> was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/regexp.rb
spec/filters/bugs/regexp.rb
# NOTE: run bin/format-filters after changing this file opal_filter "regular_expressions" do fails "MatchData#byteoffset accepts String as a reference to a named capture" # NoMethodError: undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#byteoffset accepts Symbol as a reference to a named capture" # NoMethodError: undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#byteoffset converts argument into integer if is not String nor Symbol" # NoMethodError: undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#byteoffset raises IndexError if index is out of matches" # Expected IndexError (index -1 out of matches) but got: NoMethodError (undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar">) fails "MatchData#byteoffset raises IndexError if there is no group with provided name" # Expected IndexError (undefined group name reference: y) but got: NoMethodError (undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar">) fails "MatchData#byteoffset raises TypeError if can't convert argument into Integer" # Expected TypeError (no implicit conversion of Array into Integer) but got: NoMethodError (undefined method `byteoffset' for #<MatchData "foobar" f:"foo" b:"bar">) fails "MatchData#byteoffset returns [nil, nil] if a capturing group is optional and doesn't match for multi-byte string" # NoMethodError: undefined method `byteoffset' for #<MatchData "あぃい" 1:"ぃ" 2:nil 3:"い"> fails "MatchData#byteoffset returns [nil, nil] if a capturing group is optional and doesn't match" # NoMethodError: undefined method `byteoffset' for #<MatchData "" x:nil> fails "MatchData#byteoffset returns beginning and ending byte-based offset of n-th match, all the subsequent elements are capturing groups" # NoMethodError: undefined method `byteoffset' for #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8"> fails "MatchData#byteoffset returns beginning and ending byte-based offset of whole matched substring for 0 element" # NoMethodError: undefined method `byteoffset' for #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8"> fails "MatchData#byteoffset returns correct beginning and ending byte-based offset for multi-byte strings" # NoMethodError: undefined method `byteoffset' for #<MatchData "あぃい" 1:"ぃ" 2:nil 3:"い"> fails "MatchData#deconstruct returns an array of the match captures" # NoMethodError: undefined method `deconstruct' for #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8"> fails "MatchData#deconstruct returns instances of String when given a String subclass" # NoMethodError: undefined method `deconstruct' for #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8"> fails "MatchData#deconstruct_keys does not accept non-Symbol keys" # Expected TypeError (wrong argument type String (expected Symbol)) but got: NoMethodError (undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar">) fails "MatchData#deconstruct_keys it raises error when argument is neither nil nor array" # Expected TypeError (wrong argument type Integer (expected Array)) but got: NoMethodError (undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar">) fails "MatchData#deconstruct_keys process keys till the first non-existing one" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobarbaz" f:"foo" b:"bar" c:"baz"> fails "MatchData#deconstruct_keys requires one argument" # Expected ArgumentError (wrong number of arguments (given 0, expected 1)) but got: NoMethodError (undefined method `deconstruct_keys' for #<MatchData "l">) fails "MatchData#deconstruct_keys returns only specified keys" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#deconstruct_keys returns whole hash for nil as an argument" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#deconstruct_keys returns {} when passed []" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#deconstruct_keys returns {} when passed more keys than named captured groups" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobar" f:"foo" b:"bar"> fails "MatchData#deconstruct_keys returns {} when there are no named captured groups at all" # NoMethodError: undefined method `deconstruct_keys' for #<MatchData "foobar"> fails "MatchData#regexp returns a Regexp for the result of gsub(String)" # Expected /\[/gm == /\[/ to be truthy but was false fails "MatchData#string returns a frozen copy of the matched string for gsub(String)" # NotImplementedError: String#gsub! not supported. Mutable String methods are not supported in Opal. fails "MatchData.allocate is undefined" # Expected NoMethodError but no exception was raised (#<MatchData>(#pretty_inspect raised #<NoMethodError: undefined method `named_captures' for nil>) was returned) fails "Regexp#encoding allows otherwise invalid characters if NOENCODING is specified" # NameError: uninitialized constant Regexp::NOENCODING fails "Regexp#encoding defaults to US-ASCII if the Regexp contains only US-ASCII character" # NoMethodError: undefined method `encoding' for /ASCII/ fails "Regexp#encoding defaults to UTF-8 if \\u escapes appear" # NoMethodError: undefined method `encoding' for /\u{9879}/ fails "Regexp#encoding defaults to UTF-8 if a literal UTF-8 character appears" # NoMethodError: undefined method `encoding' for /¥/ fails "Regexp#encoding ignores the default_internal encoding" # NoMethodError: undefined method `default_internal' for Encoding fails "Regexp#encoding ignores the encoding and uses US-ASCII if the string has only ASCII characters" # ArgumentError: unknown encoding name - euc-jp fails "Regexp#encoding returns BINARY if the 'n' modifier is supplied and non-US-ASCII characters are present" # NoMethodError: undefined method `encoding' for /\xc2\xa1/ fails "Regexp#encoding returns EUC_JP if the 'e' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/ fails "Regexp#encoding returns US_ASCII if the 'n' modifier is supplied and only US-ASCII characters are present" # NoMethodError: undefined method `encoding' for /ASCII/ fails "Regexp#encoding returns UTF-8 if the 'u' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/u fails "Regexp#encoding returns Windows-31J if the 's' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/ fails "Regexp#encoding returns an Encoding object" # NoMethodError: undefined method `encoding' for /glar/ fails "Regexp#encoding upgrades the encoding to that of an embedded String" # ArgumentError: unknown encoding name - euc-jp fails "Regexp#fixed_encoding? returns false by default" # NoMethodError: undefined method `fixed_encoding?' for /needle/ fails "Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/ fails "Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/ fails "Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/ fails "Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/u fails "Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal" # NoMethodError: undefined method `fixed_encoding?' for /文字化け/ fails "Regexp#fixed_encoding? returns true if the Regexp contains a \\u escape" # NoMethodError: undefined method `fixed_encoding?' for /needle \u{8768}/ fails "Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Regexp#hash is based on the text and options of Regexp" # Expected false == true to be truthy but was false fails "Regexp#hash returns the same value for two Regexps differing only in the /n option" # Expected false == true to be truthy but was false fails "Regexp#initialize raises a TypeError on an initialized non-literal Regexp" # Expected TypeError but no exception was raised (nil was returned) fails "Regexp#inspect returns options in the order 'mixn'" # Expected "/(?:)/" == "//mixn" to be truthy but was false fails "Regexp#named_captures works with duplicate capture group names" # Exception: Invalid regular expression: /this (?<is>is) [aA] (?<pat>pate?(?<is>rn))/: Duplicate capture group name fails "Regexp#names returns each capture name only once" # Exception: Invalid regular expression: /n(?<cap>ee)d(?<cap>le)/: Duplicate capture group name fails "Regexp#to_s deals properly with the two types of lookahead groups" # Expected "(?=5)" == "(?-mix:(?=5))" to be truthy but was false fails "Regexp#to_s returns a string in (?xxx:yyy) notation" # Expected "(?:.)" == "(?-mix:.)" to be truthy but was false fails "Regexp#to_s shows all options as excluded if none are selected" # Expected "abc" == "(?-mix:abc)" to be truthy but was false fails "Regexp#to_s shows non-included options after a - sign" # Expected "abc" == "(?i-mx:abc)" to be truthy but was false fails "Regexp#to_s shows the pattern after the options" # Expected "xyz" == "(?-mix:xyz)" to be truthy but was false fails "Regexp.compile given a Regexp does not honour options given as additional arguments" # Expected warning to match: /flags ignored/ but got: "" fails "Regexp.compile given a String accepts an Integer of two or more options ORed together as the second argument" # Expected 0 == 0 to be falsy but was true fails "Regexp.compile given a String raises a RegexpError when passed an incorrect regexp" # Expected RegexpError but got: Exception (Invalid regular expression: /^[$/: Unterminated character class) fails "Regexp.compile given a String with escaped characters accepts a backspace followed by a character" # Exception: Invalid regular expression: /\N/u: Invalid escape fails "Regexp.compile given a String with escaped characters accepts multiple consecutive '\\' characters" # Exception: Invalid regular expression: /\\\N/u: Invalid escape fails "Regexp.compile given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits" # Expected RegexpError but no exception was raised (/\xn/ was returned) fails "Regexp.compile given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH" # Expected RegexpError but no exception was raised (/\u304/ was returned) fails "Regexp.compile given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given" # Expected RegexpError but no exception was raised (/\u{0ffffff}/ was returned) fails "Regexp.compile given a String with escaped characters raises a RegexpError if the \\u{} escape is empty" # Expected RegexpError but no exception was raised (/\u{}/ was returned) fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /a/ fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # NoMethodError: undefined method `encoding' for /abc/ fails "Regexp.compile given a String with escaped characters returns a Regexp with UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /ÿ/ fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS fails "Regexp.compile given a String with escaped characters returns a Regexp with the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS fails "Regexp.compile works by default for subclasses with overridden #initialize" # Expected /hi/ (Regexp) to be kind of RegexpSpecsSubclass fails "Regexp.escape sets the encoding of the result to BINARY if any non-US-ASCII characters are present in an input String with invalid encoding" # Expected true to be false fails "Regexp.linear_time? accepts flags for string argument" # NoMethodError: undefined method `linear_time?' for Regexp fails "Regexp.linear_time? return false if matching can't be done in linear time" # NoMethodError: undefined method `linear_time?' for Regexp fails "Regexp.linear_time? returns true if matching can be done in linear time" # NoMethodError: undefined method `linear_time?' for Regexp fails "Regexp.linear_time? warns about flags being ignored for regexp arguments" # NoMethodError: undefined method `linear_time?' for Regexp fails "Regexp.new given a String accepts an Integer of two or more options ORed together as the second argument" # Expected 0 == 0 to be falsy but was true fails "Regexp.new given a String raises a RegexpError when passed an incorrect regexp" # Expected RegexpError but got: Exception (Invalid regular expression: /^[$/: Unterminated character class) fails "Regexp.new given a String with escaped characters accepts a backspace followed by a character" # Exception: Invalid regular expression: /\N/u: Invalid escape fails "Regexp.new given a String with escaped characters accepts multiple consecutive '\\' characters" # Exception: Invalid regular expression: /\\\N/u: Invalid escape fails "Regexp.new given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits" # Expected RegexpError but no exception was raised (/\xn/ was returned) fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given" # Expected RegexpError but no exception was raised (/\u{0ffffff}/ was returned) fails "Regexp.new given a non-String/Regexp raises TypeError if #to_str returns non-String value" # Expected TypeError (/can't convert Object to String/) but got: TypeError (can't convert Object into String (Object#to_str gives Array)) fails "Regexp.new given a non-String/Regexp raises TypeError if there is no #to_str method for non-String/Regexp argument" # Expected TypeError (no implicit conversion of Integer into String) but got: TypeError (no implicit conversion of Number into String) fails "Regexp.new works by default for subclasses with overridden #initialize" # Expected /hi/ (Regexp) to be kind of RegexpSpecsSubclass fails "Regexp.quote sets the encoding of the result to BINARY if any non-US-ASCII characters are present in an input String with invalid encoding" # Expected true to be false fails "Regexp.try_convert raises a TypeError if the object does not return an Regexp from #to_regexp" # Expected TypeError (can't convert MockObject to Regexp (MockObject#to_regexp gives String)) but got: NoMethodError (undefined method `try_convert' for Regexp) fails "Regexp.try_convert returns nil if given an argument that can't be converted to a Regexp" # NoMethodError: undefined method `try_convert' for Regexp fails "Regexp.try_convert tries to coerce the argument by calling #to_regexp" # Mock 'regexp' expected to receive to_regexp("any_args") exactly 1 times but received it 0 times fails "Regexp.union uses to_regexp to convert argument" # Mock 'pattern' expected to receive to_regexp("any_args") exactly 1 times but received it 0 times end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/cgi.rb
spec/filters/bugs/cgi.rb
# NOTE: run bin/format-filters after changing this file opal_filter "CGI" do fails "CGI#http_header CGI#http_header when passed Hash includes Cookies in the @output_cookies field" # NoMethodError: undefined method `http_header' for #<CGI:0x98198 @output_cookies=["multiple", "cookies"]> fails "CGI#http_header CGI#http_header when passed Hash returns a HTTP header based on the Hash's key/value pairs" # NoMethodError: undefined method `http_header' for #<CGI:0x98194> fails "CGI#http_header CGI#http_header when passed Hash returns a HTTP header specifying the Content-Type as text/html when passed an empty Hash" # NoMethodError: undefined method `http_header' for #<CGI:0x98190> fails "CGI#http_header CGI#http_header when passed String includes Cookies in the @output_cookies field" # NoMethodError: undefined method `http_header' for #<CGI:0x98186 @output_cookies=["multiple", "cookies"]> fails "CGI#http_header CGI#http_header when passed String returns a HTTP header specifying the Content-Type as the passed String's content" # NoMethodError: undefined method `http_header' for #<CGI:0x9818c> fails "CGI#http_header CGI#http_header when passed no arguments includes Cookies in the @output_cookies field" # NoMethodError: undefined method `http_header' for #<CGI:0x9817c @output_cookies=["multiple", "cookies"]> fails "CGI#http_header CGI#http_header when passed no arguments returns a HTTP header specifying the Content-Type as text/html" # NoMethodError: undefined method `http_header' for #<CGI:0x98182> fails "CGI#initialize is private" # Expected CGI to have private instance method 'initialize' but it does not fails "CGI#initialize when passed no arguments does not extend self with CGI::HtmlExtension" # NameError: uninitialized constant CGI::HtmlExtension fails "CGI#initialize when passed no arguments does not extend self with any of the other HTML modules" # NameError: uninitialized constant CGI::Html3 fails "CGI#initialize when passed no arguments extends self with CGI::QueryExtension" # NameError: uninitialized constant CGI::QueryExtension fails "CGI#initialize when passed no arguments sets #cookies based on ENV['HTTP_COOKIE']" # NoMethodError: undefined method `cookies' for #<CGI:0x12604> fails "CGI#initialize when passed no arguments sets #params based on ENV['QUERY_STRING'] when ENV['REQUEST_METHOD'] is GET" # NoMethodError: undefined method `params' for #<CGI:0x12614> fails "CGI#initialize when passed no arguments sets #params based on ENV['QUERY_STRING'] when ENV['REQUEST_METHOD'] is HEAD" # NoMethodError: undefined method `params' for #<CGI:0x12600> fails "CGI#initialize when passed type extends self with CGI::QueryExtension" # NameError: uninitialized constant CGI::QueryExtension fails "CGI#initialize when passed type extends self with CGI::QueryExtension, CGI::Html3 and CGI::HtmlExtension when the passed type is 'html3'" # NameError: uninitialized constant CGI::Html3 fails "CGI#initialize when passed type extends self with CGI::QueryExtension, CGI::Html4 and CGI::HtmlExtension when the passed type is 'html4'" # NameError: uninitialized constant CGI::Html4 fails "CGI#initialize when passed type extends self with CGI::QueryExtension, CGI::Html4Tr and CGI::HtmlExtension when the passed type is 'html4Tr'" # NameError: uninitialized constant CGI::Html4Tr fails "CGI#initialize when passed type extends self with CGI::QueryExtension, CGI::Html4Tr, CGI::Html4Fr and CGI::HtmlExtension when the passed type is 'html4Fr'" # NameError: uninitialized constant CGI::Html4Tr fails "CGI#out appends the block's return value to the HTML header" # NoMethodError: undefined method `out' for #<CGI:0x86a80> fails "CGI#out automatically sets the Content-Length Header based on the block's return value" # NoMethodError: undefined method `out' for #<CGI:0x86a8c> fails "CGI#out includes Cookies in the @output_cookies field" # NoMethodError: undefined method `out' for #<CGI:0x86a74 @output_cookies=["multiple", "cookies"]> fails "CGI#out it writes a HTMl header based on the passed argument to $stdout" # NoMethodError: undefined method `out' for #<CGI:0x86a86> fails "CGI#out when passed no block raises a LocalJumpError" # Expected LocalJumpError but got: NoMethodError (undefined method `out' for #<CGI:0x86a96>) fails "CGI.escape url-encodes the passed argument" # Expected "%20!%22\#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D" == "+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D" to be truthy but was false fails "CGI.escapeElement when passed String, elements, ... escapes only the tags of the passed elements in the passed String" # NoMethodError: undefined method `escapeElement' for CGI fails "CGI.escapeElement when passed String, elements, ... is case-insensitive" # NoMethodError: undefined method `escapeElement' for CGI fails "CGI.parse when passed String allows passing multiple values for one key" # NoMethodError: undefined method `parse' for CGI fails "CGI.parse when passed String parses a HTTP Query String into a Hash" # NoMethodError: undefined method `parse' for CGI fails "CGI.parse when passed String parses query strings with semicolons in place of ampersands" # NoMethodError: undefined method `parse' for CGI fails "CGI.parse when passed String unescapes keys and values" # NoMethodError: undefined method `parse' for CGI fails "CGI.pretty when passed html indents the passed html String with two spaces" # NoMethodError: undefined method `pretty' for CGI fails "CGI.pretty when passed html, indentation_unit indents the passed html String with the passed indentation_unit" # NoMethodError: undefined method `pretty' for CGI fails "CGI.rfc1123_date when passed Time returns the passed Time formatted in RFC1123 ('Sat, 01 Dec 2007 15:56:42 GMT')" # NoMethodError: undefined method `rfc1123_date' for CGI fails "CGI.unescape url-decodes the passed argument" # Expected "+!\"%23%24%%26'()*%2B%2C-.%2F0123456789%3A%3B<%3D>%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" == " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" to be truthy but was false fails "CGI.unescapeElement when passed String, elements, ... is case-insensitive" # NoMethodError: undefined method `unescapeElement' for CGI fails "CGI.unescapeElement when passed String, elements, ... unescapes only the tags of the passed elements in the passed String" # NoMethodError: undefined method `unescapeElement' for CGI end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/rational.rb
spec/filters/bugs/rational.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Rational" do fails "Rational does not respond to new" # Expected NoMethodError but got: ArgumentError ([Rational#initialize] wrong number of arguments (given 1, expected 2)) fails "Rational#coerce coerces to Rational, when given a Complex" # Expected nil == [(5/1), (3/4)] to be truthy but was false fails "Rational#coerce raises an error when passed a BigDecimal" # Expected TypeError (/BigDecimal can't be coerced into Rational/) but no exception was raised (nil was returned) fails "Rational#marshal_dump dumps numerator and denominator" # NoMethodError: undefined method `marshal_dump' for (1/2) fails "Rational#round with half option raise for a non-existent round mode" # Expected ArgumentError (invalid rounding mode: nonsense) but got: TypeError (not an Integer) fails "Rational#round with half option returns a Rational when the precision is greater than 0" # ArgumentError: [Rational#round] wrong number of arguments (given 2, expected -1) fails "Rational#round with half option returns an Integer when precision is not passed" # TypeError: not an Integer fails "Rational#to_f converts to a Float for large numerator and denominator" # Exception: Maximum call stack size exceeded fails "Rational#to_r fails when a BasicObject's to_r does not return a Rational" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182c8>) fails "Rational#to_r raises TypeError trying to convert BasicObject" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182d0>) fails "Rational#to_r works when a BasicObject has to_r" # NoMethodError: undefined method `nil?' for #<BasicObject:0x182d8> fails "Rational#truncate with an invalid value for precision does not call to_int on the argument" # Expected TypeError (not an integer) but got: TypeError (not an Integer) fails "Rational#truncate with an invalid value for precision raises a TypeError" # Expected TypeError (not an integer) but got: TypeError (not an Integer) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/module.rb
spec/filters/bugs/module.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Module" do fails "Module#alias_method creates methods that are == to each other" # Expected #<Method: #<Class:0x3c38e>#uno (defined in #<Class:0x3c38e> in ruby/core/module/fixtures/classes.rb:214)> == #<Method: #<Class:0x3c38e>#public_one (defined in ModuleSpecs::Aliasing in ruby/core/module/fixtures/classes.rb:214)> to be truthy but was false fails "Module#alias_method handles aliasing a method only present in a refinement" # Expected #<UnboundMethod: #<Module:0x3c30c>#uno_refined_method (defined in #<Module:0x3c30c> in ruby/core/module/alias_method_spec.rb:49)> == #<UnboundMethod: #<Module:0x3c30c>#double_refined_method (defined in #<Module:0x3c30c> in ruby/core/module/alias_method_spec.rb:49)> to be truthy but was false fails "Module#alias_method retains method visibility" # Expected NameError but no exception was raised (1 was returned) fails "Module#alias_method returned value returns symbol of the defined method name" # Expected #<Class:0x3c3d6> to be identical to "checking_return_value" fails "Module#append_features on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (#<Class:0x3a2da> was returned) fails "Module#attr applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned) fails "Module#attr converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false fails "Module#attr raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3a44c> was returned) fails "Module#attr returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false fails "Module#attr_accessor applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned) fails "Module#attr_accessor converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false fails "Module#attr_accessor not allows creating an attr_accessor on an immediate class" # Expected FrozenError but got: Exception (Cannot create property 'spec_attr_accessor' on boolean 'true') fails "Module#attr_accessor on immediates can read through the accessor" # NoMethodError: undefined method `foobar' for 1 fails "Module#attr_accessor raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3a710> was returned) fails "Module#attr_accessor returns an array of defined method names as symbols" # Expected nil == ["foo", "foo=", "bar", "bar="] to be truthy but was false fails "Module#attr_reader applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned) fails "Module#attr_reader converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false fails "Module#attr_reader not allows for adding an attr_reader to an immediate" # Expected RuntimeError but got: Exception (Cannot create property 'spec_attr_reader' on boolean 'true') fails "Module#attr_reader raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3ba86> was returned) fails "Module#attr_reader returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false fails "Module#attr_writer applies current visibility to methods created" # Expected NoMethodError but no exception was raised (1 was returned) fails "Module#attr_writer converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false fails "Module#attr_writer not allows for adding an attr_writer to an immediate" # Expected FrozenError but got: Exception (Cannot create property 'spec_attr_writer' on boolean 'true') fails "Module#attr_writer raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x23050> was returned) fails "Module#attr_writer returns an array of defined method names as symbols" # Expected nil == ["foo=", "bar="] to be truthy but was false fails "Module#class_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x5db0a> fails "Module#class_eval converts a non-string filename to a string using to_str" # Mock 'ruby/core/module/shared/class_eval.rb' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Module#class_eval converts non string eval-string to string using to_str" # Mock '1 + 1' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Module#class_eval raises a TypeError when the given eval-string can't be converted to string using to_str" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `encoding' for #<MockObject:0x5d8a0 @name="x" @null=nil>) fails "Module#class_eval raises a TypeError when the given filename can't be converted to string using to_str" # Expected TypeError (/can't convert MockObject to String/) but no exception was raised (2 was returned) fails "Module#class_eval raises an ArgumentError when a block and normal arguments are given" # Expected ArgumentError (wrong number of arguments (given 1, expected 0)) but got: ArgumentError (wrong number of arguments (1 for 0) NOTE:If you want to enable passing a String argument please add "require 'opal-parser'" to your script ) fails "Module#class_eval raises an ArgumentError when more than 3 arguments are given" # Expected ArgumentError (wrong number of arguments (given 4, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3)) fails "Module#class_eval raises an ArgumentError when no arguments and no block are given" # Expected ArgumentError (wrong number of arguments (given 0, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3)) fails "Module#class_eval resolves constants in the caller scope ignoring send" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup fails "Module#class_eval resolves constants in the caller scope" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup fails "Module#class_eval uses the optional filename and lineno parameters for error messages" # Expected ["test", 1] == ["test", 102] to be truthy but was false fails "Module#class_variables returns the correct class variables when inherit is given" # ArgumentError: [SubCVars.class_variables] wrong number of arguments (given 1, expected 0) fails "Module#const_added records re-definition of existing constants" # Expected warning to match: /warning: already initialized constant .+::TEST/ but got: "" fails "Module#const_defined? coerces the inherit flag to a boolean" # Expected true to be false fails "Module#const_defined? returns true for toplevel constant when the name begins with '::'" # Expected false to be true fails "Module#const_defined? returns true or false for the nested name" # Expected false == true to be truthy but was false fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is default" # Expected false to be true fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is true" # Expected false to be true fails "Module#const_defined? returns true when passed a scoped constant name" # Expected false to be true fails "Module#const_get accepts a toplevel scope qualifier when inherit is false" # NameError: uninitialized constant ConstantSpecs::CS_CONST1 fails "Module#const_get coerces the inherit flag to a boolean" # Expected NameError but no exception was raised ("const1" was returned) fails "Module#const_get raises a NameError when the nested constant does not exist on the module but exists in Object" # Expected NameError but no exception was raised ("const1" was returned) fails "Module#const_set sets the name of a module scoped by an anonymous module" # NoMethodError: undefined method `end_with?' for nil fails "Module#const_set when overwriting an existing constant does not warn after a failed autoload" # Expected NameError but got: LoadError (cannot load such file -- ruby/core/module/fixtures/autoload_o) fails "Module#const_set when overwriting an existing constant warns if the previous value was a normal value" # Expected warning to match: /already initialized constant/ but got: "" fails "Module#const_source_location accepts a String or Symbol name" # NoMethodError: undefined method `const_source_location' for Object fails "Module#const_source_location accepts a scoped constant name" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location accepts a toplevel scope qualifier" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location autoload returns the autoload location while not resolved" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location autoload returns where the constant was resolved when resolved" # LoadError: cannot load such file -- ruby/core/module/fixtures/autoload_location fails "Module#const_source_location calls #to_str to convert the given name to a String" # Mock 'ClassA' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Module#const_source_location does not search the containing scope" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location does not search the singleton class of a Class or Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location does search private constants path" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location raises a NameError if the name contains non-alphabetic characters except '_'" # NoMethodError: undefined method `const_source_location' for Object fails "Module#const_source_location raises a TypeError if conversion to a String by calling #to_str fails" # Expected TypeError but got: NoMethodError (undefined method `const_source_location' for ConstantSpecs) fails "Module#const_source_location return empty path if constant defined in C code" # NoMethodError: undefined method `const_source_location' for Object fails "Module#const_source_location returns nil if no constant is defined in the search path" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location returns nil if the constant is defined in the receiver's superclass and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location returns nil when the receiver is a Class, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location returns nil when the receiver is a Module, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ModuleA fails "Module#const_source_location returns updated location from const_set" # NoMethodError: undefined method `const_source_location' for #<Module:0x38290> fails "Module#const_source_location searches into the receiver superclasses if the inherit flag is true" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location with dynamically assigned constants returns path to the updated value of a constant" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassB fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the immediate class before the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB fails "Module#const_source_location with dynamically assigned constants searches a path in the immediate class or module first" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassA fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass before a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass chain" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location with statically assigned constants searches location path a module included in the immediate class before the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with statically assigned constants searches location path a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with statically assigned constants searches location path the immediate class or module first" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassA fails "Module#const_source_location with statically assigned constants searches location path the superclass before a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with statically assigned constants searches location path the superclass chain" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA fails "Module#const_source_location with statically assigned constants works for the module and class keywords" # NoMethodError: undefined method `const_source_location' for ConstantSpecs fails "Module#const_source_location works for eval with a given line" # NoMethodError: undefined method `const_source_location' for #<Class:0x2f66a> fails "Module#constants doesn't returns inherited constants when passed nil" # Expected ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST24", "CS_CONST5", "ChildA"] == ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST5", "ChildA"] to be truthy but was false fails "Module#constants returns only public constants" # Expected ["PRIVATE_CONSTANT", "PUBLIC_CONSTANT"] == ["PUBLIC_CONSTANT"] to be truthy but was false fails "Module#define_method defines the new method according to the scope visibility when a Method passed and the class/module of the context is equal to the receiver of #define_method" # Expected NoMethodError but no exception was raised (nil was returned) fails "Module#define_method passed { |a,| } creates a method that does not destructure the passed argument" # Expected [1, 2] == 1 to be truthy but was false fails "Module#define_method raises a TypeError when the given method is no Method/Proc" # Expected TypeError (wrong argument type Integer (expected Proc/Method/UnboundMethod)) but got: TypeError (wrong argument type Number (expected Proc/Method/UnboundMethod)) fails "Module#deprecate_constant accepts multiple symbols and strings as constant names" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf08> fails "Module#deprecate_constant raises a NameError when given an undefined name" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf04> fails "Module#deprecate_constant returns self" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf0c> fails "Module#deprecate_constant when accessing the deprecated module does not warn if Warning[:deprecated] is false" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf10> fails "Module#deprecate_constant when accessing the deprecated module passes the accessing" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf18> fails "Module#deprecate_constant when accessing the deprecated module warns with a message" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf14> fails "Module#extend_object extends the given object with its constants and methods by default" # NoMethodError: undefined method `test_method' for #<MockObject:0x2541a @name="extended direct" @null=nil> fails "Module#extend_object on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (nil was returned) fails "Module#include doesn't accept no-arguments" # Expected ArgumentError but no exception was raised (#<Module:0xdd44> was returned) fails "Module#instance_method converts non-String name by calling #to_str method" # NameError: undefined method `#<Object:0x3a942>' for class `ModuleSpecs::InstanceMeth' fails "Module#instance_method raises TypeError when passed non-String name and #to_str returns non-String value" # Expected TypeError (/can't convert Object to String/) but got: NameError (undefined method `#<Object:0x3a98e>' for class `ModuleSpecs::InstanceMeth') fails "Module#instance_method raises a NameError if the method has been undefined" # Expected #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> == #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> to be truthy but was false fails "Module#instance_method raises a TypeError if the given name is not a String/Symbol" # Expected TypeError (/is not a symbol nor a string/) but got: NameError (undefined method `' for class `Object') fails "Module#method_added is called when using #private in a subclass" # Expected [] == ["foo"] to be truthy but was false fails "Module#method_added is called with a precise caller location with the line of the 'def'" # Expected [110, 110] == [74, 77] to be truthy but was false fails "Module#method_defined? converts the given name to a string using to_str" # Expected false == true to be truthy but was false fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol" # Expected TypeError but no exception was raised (false was returned) fails "Module#method_defined? returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules" # Expected true == false to be truthy but was false fails "Module#method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#module_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x34f0c> fails "Module#module_eval converts a non-string filename to a string using to_str" # Mock 'ruby/core/module/shared/class_eval.rb' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Module#module_eval converts non string eval-string to string using to_str" # Mock '1 + 1' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Module#module_eval raises a TypeError when the given eval-string can't be converted to string using to_str" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `encoding' for #<MockObject:0x34dc8 @name="x" @null=nil>) fails "Module#module_eval raises a TypeError when the given filename can't be converted to string using to_str" # Expected TypeError (/can't convert MockObject to String/) but no exception was raised (2 was returned) fails "Module#module_eval raises an ArgumentError when a block and normal arguments are given" # Expected ArgumentError (wrong number of arguments (given 1, expected 0)) but got: ArgumentError (wrong number of arguments (1 for 0) NOTE:If you want to enable passing a String argument please add "require 'opal-parser'" to your script ) fails "Module#module_eval raises an ArgumentError when more than 3 arguments are given" # Expected ArgumentError (wrong number of arguments (given 4, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3)) fails "Module#module_eval raises an ArgumentError when no arguments and no block are given" # Expected ArgumentError (wrong number of arguments (given 0, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3)) fails "Module#module_eval resolves constants in the caller scope ignoring send" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup fails "Module#module_eval resolves constants in the caller scope" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup fails "Module#module_eval uses the optional filename and lineno parameters for error messages" # Expected ["test", 1] == ["test", 102] to be truthy but was false fails "Module#module_function as a toggle (no arguments) in a Module body does not affect module_evaled method definitions also if outside the eval itself" # Expected true == false to be truthy but was false fails "Module#module_function as a toggle (no arguments) in a Module body doesn't affect definitions when inside an eval even if the definitions are outside of it" # Expected true == false to be truthy but was false fails "Module#module_function as a toggle (no arguments) in a Module body has no effect if inside a module_eval if the definitions are outside of it" # Expected true == false to be truthy but was false fails "Module#module_function on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (nil was returned) fails "Module#module_function with specific method names raises a TypeError when the given names can't be converted to string using to_str" # Expected TypeError but got: Exception (Cannot set properties of undefined (setting 'displayName')) fails "Module#module_function with specific method names tries to convert the given names to strings using to_str" # Exception: Cannot set properties of undefined (setting 'displayName') fails "Module#name changes when the module is reachable through a constant path" # Expected nil =~ /^#<Module:0x\h+>::N$/ to be truthy but was false fails "Module#name is not nil for a nested module created with the module keyword" # Expected nil =~ /^#<Module:0x[0-9a-f]+>::N$/ to be truthy but was false fails "Module#name is not nil when assigned to a constant in an anonymous module" # NoMethodError: undefined method `end_with?' for nil fails "Module#name is set after it is removed from a constant under an anonymous module" # Expected nil =~ /^#<Module:0x\h+>::Child$/ to be truthy but was false fails "Module#prepend prepends a module if it is included in a super class" # RuntimeError: Prepending a module multiple times is not supported fails "Module#private with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x3bf72> to have private instance method 'test1' but it does not fails "Module#private with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x3bf6c> to have private instance method 'test1' but it does not fails "Module#private_class_method when single argument is passed and is an array sets the visibility of the given methods to private" # Expected NoMethodError but no exception was raised ("foo" was returned) fails "Module#private_constant marked constants in a module raises a NameError when accessed directly from modules that include the module" # Expected NameError but no exception was raised (true was returned) fails "Module#private_constant marked constants sends #const_missing to the original class or module" # Expected true == "Foo" to be truthy but was false fails "Module#private_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned) fails "Module#private_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#private_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#protected with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x59bb0> to have protected instance method 'test1' but it does not fails "Module#protected with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x59baa> to have protected instance method 'test1' but it does not fails "Module#protected_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned) fails "Module#protected_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#protected_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1) fails "Module#public_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned) fails "Module#refine and alias aliases a method within a refinement module, but not outside it" # NameError: undefined method `count' for class `' fails "Module#refine and alias_method aliases a method within a refinement module, but not outside it" # NameError: undefined method `count' for class `'
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
true
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/marshal.rb
spec/filters/bugs/marshal.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Marshal" do fails "Marshal.dump ignores the recursion limit if the limit is negative" # ArgumentError: [Marshal.dump] wrong number of arguments (given 2, expected 1) fails "Marshal.dump raises a TypeError if dumping a Mutex instance" # Expected TypeError but no exception was raised ( "\x04\bo: Mutex\x06:\f@lockedF" was returned) fails "Marshal.dump when passed a StringIO should raise an error" # Expected TypeError but no exception was raised ( "\x04\bo:\rStringIO :\f@string\"\x00:\x0E@positioni\x00:\b@fd0:\v@flags\"\arw:\t@eofF" was returned) fails "Marshal.dump with a Bignum increases the object links counter" # Expected "\x04\b[\bl+ \x00\x00\x00\x00\x00\x00\x00\x00\x01\x00o:\vObject\x00@\x06" == "\u0004\b[\bl+ \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000o:\vObject\u0000@\a" to be truthy but was false fails "Marshal.dump with a Class ignores overridden name method" # Expected "\x04\bc\bFoo" == "\x04\bc)MarshalSpec::ClassWithOverriddenName" to be truthy but was false fails "Marshal.dump with a Complex dumps a Complex" # Expected "\x04\bo:\fComplex\a: @reali\a: @imagi\b" == "\x04\bU:\fComplex[\ai\ai\b" to be truthy but was false fails "Marshal.dump with a Hash dumps a Hash subclass with compare_by_identity" # Expected "\x04\bC:\rUserHash{\x00" == "\x04\bC:\rUserHashC:\tHash{\x00" to be truthy but was false fails "Marshal.dump with a Hash dumps a Hash with compare_by_identity" # Expected "\x04\b{\x00" == "\x04\bC:\tHash{\x00" to be truthy but was false fails "Marshal.dump with a Hash dumps a non-empty Hash" # Expected "\x04\b{\x06\"\x06ai\x06" == "\x04\b{\x06:\x06ai\x06" to be truthy but was false fails "Marshal.dump with a Hash ignores overridden name method when dumps a Hash subclass" # Expected "\x04\bC:\bFoo{\x00" == "\x04\bC:(MarshalSpec::HashWithOverriddenName{\x00" to be truthy but was false fails "Marshal.dump with a Module ignores overridden name method" # Expected "\x04\bc\bFoo" == "\x04\bc*MarshalSpec::ModuleWithOverriddenName" to be truthy but was false fails "Marshal.dump with a Range raises TypeError with an anonymous Range subclass" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with a Rational dumps a Rational" # Expected "\x04\bo:\rRational\a:\t@numi\a:\t@deni\b" == "\x04\bU:\rRational[\ai\ai\b" to be truthy but was false fails "Marshal.dump with a Regexp dumps a Regexp subclass" # Expected "\x04\b/\t(?:)\x00" == "\x04\bIC:\x0FUserRegexp/\x00\x00\x06:\x06EF" to be truthy but was false fails "Marshal.dump with a Regexp dumps a Regexp with instance variables" # Expected "\x04\bI/\t(?:)\x00\x06: @ivar\"\tivar" == "\x04\bI/\x00\x00\a:\x06EF: @ivar:\tivar" to be truthy but was false fails "Marshal.dump with a Regexp dumps an ascii-compatible Regexp" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Marshal.dump with a Regexp ignores overridden name method when dumps a Regexp subclass" # Expected "\x04\b/\t(?:)\x00" == "\x04\bIC:*MarshalSpec::RegexpWithOverriddenName/\x00\x00\x06:\x06EF" to be truthy but was false fails "Marshal.dump with a String ignores overridden name method when dumps a String subclass" # Expected "\x04\bC:\bFoo\"\x00" == "\x04\bC:*MarshalSpec::StringWithOverriddenName\"\x00" to be truthy but was false fails "Marshal.dump with a Struct dumps an extended Struct" # Expected "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a\"\x06a\"\ahi:\x06b[\a\" Meths@\b" == "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a;\a\"\ahi:\x06b[\a;\x00@\a" to be truthy but was false fails "Marshal.dump with a Struct ignores overridden name method" # Expected "\x04\bS:\bFoo\x06:\x06a\"\vmember" == "\x04\bS:*MarshalSpec::StructWithOverriddenName\x06:\x06a\"\vmember" to be truthy but was false fails "Marshal.dump with a Struct raises TypeError with an anonymous Struct" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with a Symbol dumps multiple Symbols sharing the same encoding" # Expected "\x04\b[\a\"\tâ\x82¬a\"\tâ\x82¬b" == "\u0004\b[\aI:\tâ\u0082¬a\u0006:\u0006ETI:\tâ\u0082¬b\u0006;\u0006T" to be truthy but was false fails "Marshal.dump with a Time dumps a Time subclass with multibyte characters in name" # NoMethodError: undefined method `default_internal' for Encoding fails "Marshal.dump with a Time dumps the zone and the offset" # NoMethodError: undefined method `default_internal' for Encoding fails "Marshal.dump with a Time dumps the zone, but not the offset if zone is UTC" # NoMethodError: undefined method `default_internal' for Encoding fails "Marshal.dump with a Time ignores overridden name method" # NoMethodError: undefined method `default_internal' for Encoding fails "Marshal.dump with a Time raises TypeError with an anonymous Time subclass" # NoMethodError: undefined method `default_internal' for Encoding fails "Marshal.dump with an Array ignores overridden name method when dumps an Array subclass" # Expected "\x04\bC:\bFoo[\x00" == "\x04\bC:)MarshalSpec::ArrayWithOverriddenName[\x00" to be truthy but was false fails "Marshal.dump with an Exception contains the filename in the backtrace" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0:\x0F@backtrace[\x06\"\x12foo/bar.rb:10" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt[\x06\"\x12foo/bar.rb:10" to be truthy but was false fails "Marshal.dump with an Exception dumps an empty Exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg0:\abt0" to be truthy but was false fails "Marshal.dump with an Exception dumps instance variables if they exist" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0: @ivari\x06" == "\x04\bo:\x0EException\b:\tmesg\"\bfoo:\abt0: @ivari\x06" to be truthy but was false fails "Marshal.dump with an Exception dumps the cause for the exception" # Expected "StandardError" == "the cause" to be truthy but was false fails "Marshal.dump with an Exception dumps the message for the exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt0" to be truthy but was false fails "Marshal.dump with an Exception dumps the message for the raised NoMethodError exception" # Expected "\x04\bo:\x12NoMethodError\t: @name\"\bfoo:\v@cause0: @args[\x00:\x0F@backtrace[)\"=ruby/core/marshal/dump_spec.rb:739:11:in `instance_exec'\"@<internal:corelib/basic_object.rb>:126:1:in `instance_exec'\".mspec/runner/mspec.rb:117:11:in `protect'\"-mspec/runner/context.rb:176:39:in `$$17'\"4<internal:corelib/enumerable.rb>:28:16:in `$$3'\"0<internal:corelib/array.rb>:976:1:in `each'\"E<internal:corelib/enumerable.rb>:27:7:in `Enumerable_all$ques$1'\"0mspec/runner/context.rb:176:18:in `protect'\"-mspec/runner/context.rb:212:26:in `$$21'\",mspec/runner/mspec.rb:285:7:in `repeat'\"-mspec/runner/context.rb:204:16:in `$$20'\"0<internal:corelib/array.rb>:976:1:in `each'\"0mspec/runner/context.rb:203:18:in `process'\"-mspec/runner/context.rb:235:34:in `$$23'\"0<internal:corelib/array.rb>:976:1:in `each'\"0mspec/runner/context.rb:235:13:in `process'\".mspec/runner/mspec.rb:56:10:in `describe'\"/mspec/runner/object.rb:11:10:in `describe'\"Uruby/core/marshal/dump_spec.rb:6:1:in `Opal.modules.ruby/core/marshal/dump_spec'\"1<internal:corelib/kernel.rb>:591:6:in `load'\"4mspec/runner/mspec.rb:100:42:in `instance_exec'\"@<internal:corelib/basic_object.rb>:126:1:in `instance_exec'\".mspec/runner/mspec.rb:117:11:in `protect'\")mspec/runner/mspec.rb:100:7:in `$$1'\"0<internal:corelib/array.rb>:976:1:in `each'\"/mspec/runner/mspec.rb:91:12:in `each_file'\"*mspec/runner/mspec.rb:96:5:in `files'\",mspec/runner/mspec.rb:64:5:in `process'\".tmp/mspec_nodejs.rb:3975:6:in `undefined'\"&tmp/mspec_nodejs.rb:1:1:in `null'\"Bnode:internal/modules/cjs/loader:1241:14:in `Module._compile'\"Inode:internal/modules/cjs/loader:1295:10:in `Module._extensions..js'\">node:internal/modules/cjs/loader:1091:32:in `Module.load'\">node:internal/modules/cjs/loader:938:12:in `Module._load'\"Dnode:internal/modules/run_main:83:12:in `executeUserEntryPoint'\"<node:internal/main/run_main_module:23:47:in `undefined'" =~ /undefined method `foo' for ("":String|an instance of String)/ to be truthy but was nil fails "Marshal.dump with an Exception raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with an Object dumps a BasicObject subclass if it defines respond_to?" # NoMethodError: undefined method `object_id' for #<MarshalSpec::BasicObjectSubWithRespondToFalse:0x8585e> fails "Marshal.dump with an Object dumps an Object with a non-US-ASCII instance variable" # NameError: '@é' is not allowed as an instance variable name fails "Marshal.dump with an Object ignores overridden name method" # Expected "\x04\bo:\bFoo\x00" == "\x04\bo:)MarshalSpec::ClassWithOverriddenName\x00" to be truthy but was false fails "Marshal.dump with an Object raises TypeError if an Object extends an anonymous module" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with an Object raises TypeError if an Object has a singleton class and singleton instance variables" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned) fails "Marshal.dump with an Object raises TypeError if an Object has a singleton class and singleton methods" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned) fails "Marshal.dump with an Object raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with an object responding to #_dump Core library classes with #_dump returning a String with instance variables indexes instance variables and then a Time object itself" # Expected "\x04\b[\ao:\tTime\x06:\x0E@timezonei\x00@\x06" == "\u0004\b[\aIu:\tTime\r \u0080\u001EÀ\u0000\u0000\u0000\u0000\u0006:\tzoneI\"\bUTC\u0006:\u0006EF@\a" to be truthy but was false fails "Marshal.dump with an object responding to #_dump dumps the String in multibyte encoding" # Expected "\x04\bu:\x16UserDefinedString\x06a" == "\x04\bIu:\x16UserDefinedString\ta\x00\x00\x00\x06:\rencoding\"\rUTF-32LE" to be truthy but was false fails "Marshal.dump with an object responding to #_dump dumps the String in non US-ASCII and non UTF-8 encoding" # ArgumentError: unknown encoding name - windows-1251 fails "Marshal.dump with an object responding to #_dump dumps the String returned by #_dump" # Expected "\x04\bu:\x10UserDefined\x17\x04\b[\a\" stuff\" stuff" == "\x04\bu:\x10UserDefined\x12\x04\b[\a: stuff;\x00" to be truthy but was false fails "Marshal.dump with an object responding to #_dump ignores overridden name method" # Expected "\x04\bu:\bFoo\x17\x04\b[\a\" stuff\" stuff" == "\x04\bu:/MarshalSpec::UserDefinedWithOverriddenName\x12\x04\b[\a: stuff;\x00" to be truthy but was false fails "Marshal.dump with an object responding to #_dump indexes instance variables of a String returned by #_dump at first and then indexes the object itself" # Expected "\x04\b[\au:\x17MarshalSpec::M1::A\v<dump>u:\x17MarshalSpec::M1::A\v<dump>" == "\u0004\b[\aIu:\u0017MarshalSpec::M1::A\v<dump>\u0006:\t@foo\"\bbar@\a" to be truthy but was false fails "Marshal.dump with an object responding to #_dump raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil) fails "Marshal.dump with an object responding to #marshal_dump raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: Exception (Cannot read properties of undefined (reading '$equal?')) fails "Marshal.load for a Complex loads" # Expected (4+3i).frozen? to be truthy but was false fails "Marshal.load for a Hash preserves compare_by_identity behaviour for a Hash subclass" # Expected {}.compare_by_identity? to be truthy but was false fails "Marshal.load for a Hash preserves compare_by_identity behaviour" # Expected {"a"=>1}.compare_by_identity? to be truthy but was false fails "Marshal.load for a Module loads an old module" # NotImplementedError: ModuleOld type cannot be demarshaled yet fails "Marshal.load for a Rational loads" # Expected (1/3).frozen? to be truthy but was false fails "Marshal.load for a Regexp loads a Regexp subclass instance variables when it is extended with a module" # Expected [Meths, Regexp, Object] == [Meths, UserRegexp, Regexp] to be truthy but was false fails "Marshal.load for a Regexp loads an extended Regexp" # Expected /[a-z]/ == /(?:)/ to be truthy but was false fails "Marshal.load for a Regexp preserves Regexp encoding" # NoMethodError: undefined method `encoding' for /a/ fails "Marshal.load for a Regexp raises ArgumentError when end of byte sequence reached before source string end" # Expected "\x04\b/\x10hello world\x00" == "\x04\bI/\x10hello world\x00\x06:\x06EF" to be truthy but was false fails "Marshal.load for a String loads a String as BINARY if no encoding is specified at the end" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false fails "Marshal.load for a String loads a String subclass with custom constructor" # ArgumentError: [UserCustomConstructorString#initialize] wrong number of arguments (given 1, expected 2) fails "Marshal.load for a String sets binmode if it is loading through StringIO stream" # Expected RuntimeError (binmode) but got: TypeError (incompatible marshal file format (can't be read)) fails "Marshal.load for a Struct does not call initialize on the unmarshaled struct" # Expected ["foo"] == nil to be truthy but was false fails "Marshal.load for a Symbol loads a Symbol" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Marshal.load for a Symbol loads a binary encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false fails "Marshal.load for a Symbol loads an encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false fails "Marshal.load for a Symbol raises ArgumentError when end of byte sequence reached before symbol characters end" # Expected "\x04\b\" hello" == "\x04\b: hello" to be truthy but was false fails "Marshal.load for a Time keeps nanoseconds" # NoMethodError: undefined method `nsec' for 2023-09-20 22:51:57 +0200 fails "Marshal.load for a Time keeps the zone" # Expected "Central European Summer Time" == "AST" to be truthy but was false fails "Marshal.load for a Time keeps utc offset" # Expected 540 == 32400 to be truthy but was false fails "Marshal.load for a Time loads" # Expected 2022-12-07 05:35:14 +0100 == 1970-01-01 01:00:01 +0100 to be truthy but was false fails "Marshal.load for a user object that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type" # Expected ArgumentError but got: TypeError (no implicit conversion of Hash into Integer) fails "Marshal.load for an Exception loads a marshalled exception with a backtrace" # Expected "Exception" == "foo" to be truthy but was false fails "Marshal.load for an Exception loads a marshalled exception with a message" # Expected "Exception" == "foo" to be truthy but was false fails "Marshal.load for an Exception loads a marshalled exception with no message" # Expected ["<internal:corelib/class.rb>:19:1:in `allocate'", "<internal:corelib/marshal/read_buffer.rb>:392:21:in `read_object'", "<internal:corelib/marshal/read_buffer.rb>:78:9:in `read'", "<internal:corelib/marshal.rb>:14:38:in `__send__'", "<internal:corelib/basic_object.rb>:40:1:in `__send__'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `Opal.send'", "<internal:corelib/runtime.js>:2124:7:in `send'", "ruby/core/marshal/shared/load.rb:570:23: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/context.rb:235:34:in `$$23'", "<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:235:13: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/marshal/load_spec.rb:4:1:in `Opal.modules.ruby/core/marshal/load_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'"] == ["ruby/core/marshal/shared/load.rb:569:22: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/context.rb:235:34:in `$$23'", "<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:235:13: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/marshal/load_spec.rb:4:1:in `Opal.modules.ruby/core/marshal/load_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 truthy but was false fails "Marshal.load for an Exception loads an marshalled exception with ivars" # Expected "Exception" == "foo" to be truthy but was false fails "Marshal.load for an Object loads an Object with a non-US-ASCII instance variable" # NameError: '@é' is not allowed as an instance variable name fails "Marshal.load for an Object raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class" # Expected ArgumentError but no exception was raised (#<File:0x89744 @path="/etc/passwd"> was returned) fails "Marshal.load for an object responding to #marshal_dump and #marshal_load loads a user-marshaled object" # Expected "\x04\b[\aU:\x10UserMarshal\"\tdata@\x06" == "\x04\b[\aU:\x10UserMarshal:\tdata;\x06" to be truthy but was false fails "Marshal.load loads an array containing objects having _dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load loads an array containing objects having marshal_dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when a class does not exist in the namespace raises an ArgumentError" # Expected ArgumentError (undefined class/module NamespaceTest::SameName) but no exception was raised (#<SameName:0x89b06> was returned) fails "Marshal.load when called on objects with custom _dump methods loads the String in non US-ASCII and non UTF-8 encoding" # ArgumentError: unknown encoding name - windows-1251 fails "Marshal.load when called with a proc call the proc with extended objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with a proc call the proc with fully initialized strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with a proc calls the proc for recursively visited data" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with a proc loads an Array with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with a proc no longer mutate the object after it was passed to the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with a proc returns the value of the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true deep freezing deduplicates frozen strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true deep freezing returns arrays with frozen elements" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true deep freezing returns hashes with frozen keys and values" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true deep freezing returns objects with frozen instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true deep freezing returns structs with frozen members" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true does freeze extended objects with instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true does freeze extended objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true does not call freeze method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns a frozen object when is an instance of String/Array/Regexp/Hash subclass and has instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen object even if object does not respond to freeze method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen object extended by a module" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen object having #_dump method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen object responding to #marshal_dump and #marshal_load" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with freeze: true returns frozen structs" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) fails "Marshal.load when called with nil for the proc argument behaves as if no proc argument was passed" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/objectspace.rb
spec/filters/bugs/objectspace.rb
# NOTE: run bin/format-filters after changing this file opal_filter "ObjectSpace" do fails "ObjectSpace._id2ref converts an object id to a reference to the object" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref raises RangeError when an object could not be found" # Expected RangeError but got: NoMethodError (undefined method `_id2ref' for ObjectSpace) fails "ObjectSpace._id2ref retrieves a String by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves a Symbol by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves a frozen literal String by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves a large Integer by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves a small Integer by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves an Encoding by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves false by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves nil by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace._id2ref retrieves true by object_id" # NoMethodError: undefined method `_id2ref' for ObjectSpace fails "ObjectSpace.define_finalizer allows multiple finalizers with different 'callables' to be defined" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer calls a finalizer at exit even if it is indirectly self-referencing" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer calls a finalizer at exit even if it is self-referencing" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer calls a finalizer defined in a finalizer running at exit" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer calls finalizer on process termination" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer warns if the finalizer has the object as the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer warns if the finalizer is a method bound to the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer warns if the finalizer was a block in the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c> fails "ObjectSpace.define_finalizer when $VERBOSE is nil does not warn even if an exception is raised in finalizer" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6e408> fails "ObjectSpace.define_finalizer when $VERBOSE is not nil warns if an exception is raised in finalizer" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6e408> fails "ObjectSpace.each_object calls the block once for each class, module in the Ruby process" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object calls the block once for each living, non-immediate object in the Ruby process" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object captured in an at_exit handler" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object captured in finalizer" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a fiber local" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a global variable" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a hash key" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a hash value" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable captured in a Kernel#binding" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable captured in a Proc#binding" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable captured in a block explicitly" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable captured in a block implicitly" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable captured in by a method defined with a block" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable set in a binding manually" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a local variable" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a second-level constant" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in a thread local" # NotImplementedError: Thread creation not available fails "ObjectSpace.each_object finds an object stored in a top-level constant" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in an array" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object finds an object stored in an instance variable" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object on singleton classes does not walk hidden metaclasses" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object on singleton classes walks singleton classes" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object returns an enumerator if not given a block" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.each_object walks a class and its normal descendants when passed the class's singleton class" # NoMethodError: undefined method `each_object' for ObjectSpace fails "ObjectSpace.garbage_collect accepts keyword arguments" # NoMethodError: undefined method `garbage_collect' for ObjectSpace fails "ObjectSpace.garbage_collect always returns nil" # NoMethodError: undefined method `garbage_collect' for ObjectSpace fails "ObjectSpace.garbage_collect can be invoked without any exceptions" # Expected to not get Exception but got: NoMethodError (undefined method `garbage_collect' for ObjectSpace) fails "ObjectSpace.garbage_collect ignores the supplied block" # Expected to not get Exception but got: NoMethodError (undefined method `garbage_collect' for ObjectSpace) fails "ObjectSpace::WeakMap#[] matches using identity semantics" # Expected "x" == nil to be truthy but was false fails "ObjectSpace::WeakMap#each is correct" # NotImplementedError: #each can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#each_key is correct" # NotImplementedError: #each_key can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#each_key must take a block, except when empty" # NotImplementedError: #each can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#each_pair is correct" # NotImplementedError: #each_pair can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#each_value is correct" # NotImplementedError: #each_value can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#include? matches using identity semantics" # Expected true == false to be truthy but was false fails "ObjectSpace::WeakMap#include? reports true if the pair exists and the value is nil" # NotImplementedError: #size can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#inspect displays object pointers in output" # Expected "#<ObjectSpace::WeakMap:0x5b4d0 @weak_map=[object WeakMap] @primitive_map={}>" =~ /^\#<ObjectSpace::WeakMap:0x\h+>$/ to be truthy but was nil fails "ObjectSpace::WeakMap#key? matches using identity semantics" # Expected true == false to be truthy but was false fails "ObjectSpace::WeakMap#key? reports true if the pair exists and the value is nil" # NotImplementedError: #size can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#keys is correct" # NotImplementedError: #keys can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#length is correct" # NotImplementedError: #length can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#member? matches using identity semantics" # Expected true == false to be truthy but was false fails "ObjectSpace::WeakMap#member? reports true if the pair exists and the value is nil" # NotImplementedError: #size can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#size is correct" # NotImplementedError: #size can't be implemented on top of JS interfaces fails "ObjectSpace::WeakMap#values is correct" # NotImplementedError: #values can't be implemented on top of JS interfaces end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/bigdecimal.rb
spec/filters/bugs/bigdecimal.rb
# NOTE: run bin/format-filters after changing this file opal_filter "BigDecimal" do fails "BidDecimal#hash two BigDecimal objects with numerically equal values should have the same hash value" # Expected 417830 == 417834 to be truthy but was false fails "BidDecimal#hash two BigDecimal objects with the same value should have the same hash for NaNs" # Expected 417786 == 417790 to be truthy but was false fails "BidDecimal#hash two BigDecimal objects with the same value should have the same hash for infinite values" # Expected 417742 == 417746 to be truthy but was false fails "BidDecimal#hash two BigDecimal objects with the same value should have the same hash for ordinary values" # Expected 417698 == 417702 to be truthy but was false fails "BidDecimal#hash two BigDecimal objects with the same value should have the same hash for zero values" # Expected 417654 == 417658 to be truthy but was false fails "BigDecimal constants exception-related constants has a EXCEPTION_ALL value" # NameError: uninitialized constant BigDecimal::EXCEPTION_ALL fails "BigDecimal constants exception-related constants has a EXCEPTION_INFINITY value" # NameError: uninitialized constant BigDecimal::EXCEPTION_INFINITY fails "BigDecimal constants exception-related constants has a EXCEPTION_NaN value" # NameError: uninitialized constant BigDecimal::EXCEPTION_NaN fails "BigDecimal constants exception-related constants has a EXCEPTION_OVERFLOW value" # NameError: uninitialized constant BigDecimal::EXCEPTION_OVERFLOW fails "BigDecimal constants exception-related constants has a EXCEPTION_UNDERFLOW value" # NameError: uninitialized constant BigDecimal::EXCEPTION_UNDERFLOW fails "BigDecimal constants exception-related constants has a EXCEPTION_ZERODIVIDE value" # NameError: uninitialized constant BigDecimal::EXCEPTION_ZERODIVIDE fails "BigDecimal constants has a BASE value" # NameError: uninitialized constant BigDecimal::BASE fails "BigDecimal constants has a NaN value" # NameError: uninitialized constant BigDecimal::NAN fails "BigDecimal constants has an INFINITY value" # NameError: uninitialized constant BigDecimal::INFINITY fails "BigDecimal constants rounding-related constants has a ROUND_CEILING value" # Expected 2 == 5 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_DOWN value" # Expected 1 == 2 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_FLOOR value" # Expected 3 == 6 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_HALF_DOWN value" # Expected 5 == 4 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_HALF_EVEN value" # Expected 6 == 7 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_HALF_UP value" # Expected 4 == 3 to be truthy but was false fails "BigDecimal constants rounding-related constants has a ROUND_UP value" # Expected 0 == 1 to be truthy but was false fails "BigDecimal is not defined unless it is required" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1bb6a> fails "BigDecimal#% returns NaN if NaN is involved" # FloatDomainError: Computation results to 'NaN'(Not a Number) fails "BigDecimal#% returns NaN if the dividend is Infinity" # FloatDomainError: Computation results to 'Infinity' fails "BigDecimal#% returns self modulo other" # Exception: new BigNumber() number type has more than 15 significant digits: 18446744073709552000 fails "BigDecimal#% returns the dividend if the divisor is Infinity" # Expected NaN == 1 to be truthy but was false fails "BigDecimal#% with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(6543.21) exactly 1 times but received it 0 times fails "BigDecimal#* with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(3e-20001) exactly 1 times but received it 0 times fails "BigDecimal#* with Rational produces a BigDecimal" # TypeError: Rational can't be coerced into BigDecimal fails "BigDecimal#** powers of self" # Expected 0 == 5e-40002 to be truthy but was false fails "BigDecimal#+ with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#- with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#-@ properly handles special values" # Expected 1 == -1 to be truthy but was false fails "BigDecimal#/ returns a / b" # Expected 0 == -5e-5556 to be truthy but was false fails "BigDecimal#/ with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#/ with Rational produces a BigDecimal" # TypeError: Rational can't be coerced into BigDecimal fails "BigDecimal#< properly handles infinity values" # NoMethodError: undefined method `nan?' for #<MockObject:0x26d44 @name="123" @null=nil> fails "BigDecimal#<= properly handles infinity values" # NoMethodError: undefined method `nan?' for #<MockObject:0x66d8a @name="123" @null=nil> fails "BigDecimal#<=> returns -1 if a < b" # Expected nil == -1 to be truthy but was false fails "BigDecimal#<=> returns 1 if a > b" # Expected nil == 1 to be truthy but was false fails "BigDecimal#> properly handles infinity values" # NoMethodError: undefined method `nan?' for #<MockObject:0x21ba0 @name="123" @null=nil> fails "BigDecimal#>= properly handles infinity values" # NoMethodError: undefined method `nan?' for #<MockObject:0x1b650 @name="123" @null=nil> fails "BigDecimal#add with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(123450000000000) exactly 1 times but received it 0 times fails "BigDecimal#add with Rational produces a BigDecimal" # TypeError: Rational can't be coerced into BigDecimal fails "BigDecimal#ceil returns the smallest integer greater or equal to self, if n is unspecified" # Expected Infinity == 2e+5555 to be truthy but was false fails "BigDecimal#ceil sets n digits left of the decimal point to 0, if given n < 0" # Expected 13346 == 13400 to be truthy but was false fails "BigDecimal#coerce returns [other, self] both as BigDecimal" # Exception: new BigNumber() number type has more than 15 significant digits: 32434234234234233000 fails "BigDecimal#div returns a / b with optional precision" # Expected "0.33333333333333333333" == "0.333333333333333333333" to be truthy but was false fails "BigDecimal#div with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#div with precision set to 0 returns a / b" # Expected 0 == -5e-5556 to be truthy but was false fails "BigDecimal#div with precision set to 0 with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#divmod array contains quotient and modulus as BigDecimal" # Expected [0, 1] == [-1, -1] to be truthy but was false fails "BigDecimal#divmod can be reversed with * and +" # Expected 0 == -1 to be truthy but was false fails "BigDecimal#divmod returns an array of Infinity and NaN if the dividend is Infinity" # FloatDomainError: Computation results to 'Infinity' fails "BigDecimal#divmod returns an array of two NaNs if NaN is involved" # FloatDomainError: Computation results to 'NaN'(Not a Number) fails "BigDecimal#divmod returns an array of zero and the dividend if the divisor is Infinity" # Expected NaN == 1 to be truthy but was false fails "BigDecimal#exponent is n if number can be represented as 0.xxx*10**n" # NoMethodError: undefined method `exponent' for 2e+1000 fails "BigDecimal#exponent returns 0 if self is 0" # NoMethodError: undefined method `exponent' for 0 fails "BigDecimal#exponent returns an Integer" # NoMethodError: undefined method `exponent' for Infinity fails "BigDecimal#floor raise exception, if self is special value" # Expected FloatDomainError but no exception was raised (Infinity was returned) fails "BigDecimal#floor returns the greatest integer smaller or equal to self" # Expected Infinity == 2e+5555 to be truthy but was false fails "BigDecimal#floor sets n digits left of the decimal point to 0, if given n < 0" # Expected -9.999999999999999e+29 == -1e+30 to be truthy but was false fails "BigDecimal#frac correctly handles special values" # NoMethodError: undefined method `frac' for Infinity fails "BigDecimal#frac returns 0 if the value is 0" # NoMethodError: undefined method `frac' for 0 fails "BigDecimal#frac returns 0 if the value is an integer" # NoMethodError: undefined method `frac' for 2e+5555 fails "BigDecimal#frac returns a BigDecimal" # NoMethodError: undefined method `frac' for 2e+5555 fails "BigDecimal#frac returns the fractional part of the absolute value" # NoMethodError: undefined method `frac' for 1.23456789 fails "BigDecimal#inspect does not add an exponent for zero values" # Expected "0" == "0.0" to be truthy but was false fails "BigDecimal#inspect looks like this" # Expected "1234.5678" == "0.12345678e4" to be truthy but was false fails "BigDecimal#mod_part_of_divmod returns NaN if NaN is involved" # FloatDomainError: Computation results to 'NaN'(Not a Number) fails "BigDecimal#mod_part_of_divmod returns NaN if the dividend is Infinity" # FloatDomainError: Computation results to 'Infinity' fails "BigDecimal#mod_part_of_divmod returns self modulo other" # Exception: new BigNumber() number type has more than 15 significant digits: 18446744073709552000 fails "BigDecimal#mod_part_of_divmod returns the dividend if the divisor is Infinity" # Expected NaN == 1 to be truthy but was false fails "BigDecimal#mod_part_of_divmod with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(6543.21) exactly 1 times but received it 0 times fails "BigDecimal#modulo returns NaN if NaN is involved" # FloatDomainError: Computation results to 'NaN'(Not a Number) fails "BigDecimal#modulo returns NaN if the dividend is Infinity" # FloatDomainError: Computation results to 'Infinity' fails "BigDecimal#modulo returns self modulo other" # Exception: new BigNumber() number type has more than 15 significant digits: 18446744073709552000 fails "BigDecimal#modulo returns the dividend if the divisor is Infinity" # Expected NaN == 1 to be truthy but was false fails "BigDecimal#modulo with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(6543.21) exactly 1 times but received it 0 times fails "BigDecimal#mult with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(3e-20001) exactly 1 times but received it 0 times fails "BigDecimal#power powers of self" # Expected 0 == 5e-40002 to be truthy but was false fails "BigDecimal#precs returns Integers as array values" # NameError: uninitialized constant BigDecimal::BASE fails "BigDecimal#precs returns array of two values" # NameError: uninitialized constant BigDecimal::BASE fails "BigDecimal#precs returns the current value of significant digits as the first value" # NameError: uninitialized constant BigDecimal::BASE fails "BigDecimal#precs returns the maximum number of significant digits as the second value" # NameError: uninitialized constant BigDecimal::BASE fails "BigDecimal#quo returns a / b" # Expected 0 == -5e-5556 to be truthy but was false fails "BigDecimal#quo with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(1) exactly 1 times but received it 0 times fails "BigDecimal#remainder coerces arguments to BigDecimal if possible" # NoMethodError: undefined method `remainder' for 3 fails "BigDecimal#remainder it equals modulo, if both values are of same sign" # NoMethodError: undefined method `remainder' for 1.234567890123456789012345679e+27 fails "BigDecimal#remainder means self-arg*(self/arg).truncate" # NoMethodError: undefined method `remainder' for 1.23456789 fails "BigDecimal#remainder raises TypeError if the argument cannot be coerced to BigDecimal" # Expected TypeError but got: NoMethodError (undefined method `remainder' for 1) fails "BigDecimal#remainder returns NaN if Infinity is involved" # NoMethodError: undefined method `remainder' for Infinity fails "BigDecimal#remainder returns NaN if NaN is involved" # NoMethodError: undefined method `remainder' for NaN fails "BigDecimal#remainder returns NaN used with zero" # NoMethodError: undefined method `remainder' for 1.23456789 fails "BigDecimal#remainder returns zero if used on zero" # NoMethodError: undefined method `remainder' for 0 fails "BigDecimal#remainder with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(3) exactly 1 times but received it 0 times fails "BigDecimal#round :banker rounds values > 5 up, < 5 down and == 5 towards even neighbor" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :ceil rounds values towards +infinity" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :ceiling rounds values towards +infinity" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :default rounds values >= 5 up, otherwise down" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :down rounds values towards zero" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :floor rounds values towards -infinity" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :half_down rounds values > 5 up, otherwise down" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :half_even rounds values > 5 up, < 5 down and == 5 towards even neighbor" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :half_up rounds values >= 5 up, otherwise down" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :truncate rounds values towards zero" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round :up rounds values away from zero" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_CEILING rounds values towards +infinity" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_DOWN rounds values towards zero" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_FLOOR rounds values towards -infinity" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_HALF_DOWN rounds values > 5 up, otherwise down" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_HALF_EVEN rounds values > 5 up, < 5 down and == 5 towards even neighbor" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_HALF_UP rounds values >= 5 up, otherwise down" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round BigDecimal::ROUND_UP rounds values away from zero" # ArgumentError: [BigDecimal#round] wrong number of arguments (given 2, expected -1) fails "BigDecimal#round raise for a non-existent round mode" # Expected ArgumentError (invalid rounding mode) but got: ArgumentError ([BigDecimal#round] wrong number of arguments (given 2, expected -1)) fails "BigDecimal#round uses default rounding method unless given" # Expected -1 == -2 to be truthy but was false fails "BigDecimal#sign returns negative value if BigDecimal less than 0" # Expected nil == -2 to be truthy but was false fails "BigDecimal#sign returns positive value if BigDecimal greater than 0" # Expected nil == 2 to be truthy but was false fails "BigDecimal#split first value: -1 for numbers < 0" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split first value: 0 if BigDecimal is NaN" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split first value: 1 for numbers > 0" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split fourth value: the exponent" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split second value: a string with the significant digits" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split splits BigDecimal in an array with four values" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#split third value: the base (currently always ten)" # NoMethodError: undefined method `split' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "BigDecimal#sqrt raises ArgumentError if 2 arguments are given" # Expected ArgumentError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt raises ArgumentError if a negative number is given" # Expected ArgumentError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt raises ArgumentError when no argument is given" # Expected ArgumentError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt raises FloatDomainError for NaN" # Expected FloatDomainError but got: NoMethodError (undefined method `sqrt' for NaN) fails "BigDecimal#sqrt raises FloatDomainError for negative infinity" # Expected FloatDomainError but got: NoMethodError (undefined method `sqrt' for -Infinity) fails "BigDecimal#sqrt raises FloatDomainError on negative values" # Expected FloatDomainError but got: NoMethodError (undefined method `sqrt' for -1) fails "BigDecimal#sqrt raises TypeError if a plain Object is given" # Expected TypeError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt raises TypeError if a string is given" # Expected TypeError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt raises TypeError if nil is given" # Expected TypeError but got: NoMethodError (undefined method `sqrt' for 1) fails "BigDecimal#sqrt returns 0 for 0, +0.0 and -0.0" # NoMethodError: undefined method `sqrt' for 0 fails "BigDecimal#sqrt returns 1 if precision is 0 or 1" # NoMethodError: undefined method `sqrt' for 1 fails "BigDecimal#sqrt returns positive infinity for infinity" # NoMethodError: undefined method `sqrt' for Infinity fails "BigDecimal#sqrt returns square root of 0.9E-99999 with desired precision" # NoMethodError: undefined method `sqrt' for 9e-100000 fails "BigDecimal#sqrt returns square root of 121 with desired precision" # NoMethodError: undefined method `sqrt' for 121 fails "BigDecimal#sqrt returns square root of 2 with desired precision" # NoMethodError: undefined method `sqrt' for 2 fails "BigDecimal#sqrt returns square root of 3 with desired precision" # NoMethodError: undefined method `sqrt' for 3 fails "BigDecimal#sub with Object tries to coerce the other operand to self" # Mock 'Object' expected to receive coerce(123450000000000) exactly 1 times but received it 0 times fails "BigDecimal#sub with Rational produces a BigDecimal" # TypeError: Rational can't be coerced into BigDecimal fails "BigDecimal#to_f properly handles special values" # Expected "0" == "0.0" to be truthy but was false fails "BigDecimal#to_i raises FloatDomainError if BigDecimal is infinity or NaN" # Expected FloatDomainError but got: NoMethodError (undefined method `to_i' for Infinity) fails "BigDecimal#to_i returns Integer otherwise" # NoMethodError: undefined method `to_i' for 3e-20001 fails "BigDecimal#to_int raises FloatDomainError if BigDecimal is infinity or NaN" # Expected FloatDomainError but got: NoMethodError (undefined method `to_i' for Infinity) fails "BigDecimal#to_int returns Integer otherwise" # NoMethodError: undefined method `to_i' for 3e-20001 fails "BigDecimal#to_r returns a Rational from a BigDecimal with an exponent" # NoMethodError: undefined method `to_r' for 100 fails "BigDecimal#to_r returns a Rational from a negative BigDecimal with an exponent" # NoMethodError: undefined method `to_r' for -100 fails "BigDecimal#to_r returns a Rational with bignum values" # NoMethodError: undefined method `to_r' for 3.141592653589793238462643 fails "BigDecimal#to_r returns a Rational" # NoMethodError: undefined method `to_r' for 3.14159 fails "BigDecimal#to_s can return a leading space for values > 0" # Expected "3.14159265358979323846264338327950288419716939937" =~ /\ .*/ to be truthy but was nil fails "BigDecimal#to_s can use conventional floating point notation" # Expected "123.4567890123456789" == "+123.45678901 23456789" to be truthy but was false fails "BigDecimal#to_s can use engineering notation" # Expected "3.14159265358979323846264338327950288419716939937" =~ /^0\.[0-9]*E[0-9]*$/i to be truthy but was nil fails "BigDecimal#to_s does not add an exponent for zero values" # Expected "0" == "0.0" to be truthy but was false fails "BigDecimal#to_s inserts a space every n chars to fraction part, if integer n is supplied" # Expected "3.14159265358979323846264338327950288419716939937" =~ /\A0\.314 159 265 358 979 323 846 264 338 327 950 288 419 716 939 937E1\z/i to be truthy but was nil fails "BigDecimal#to_s removes trailing spaces in floating point notation" # Expected "0" == "0.0" to be truthy but was false fails "BigDecimal#to_s returns a String in US-ASCII encoding when Encoding.default_internal is nil" # Expected #<Encoding:UTF-8> to be identical to #<Encoding:US-ASCII> fails "BigDecimal#to_s returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # Expected #<Encoding:UTF-8> to be identical to #<Encoding:US-ASCII> fails "BigDecimal#to_s starts with + if + is supplied and value is positive" # Expected "3.14159265358979323846264338327950288419716939937" =~ /^\+.*/ to be truthy but was nil fails "BigDecimal#to_s the default format looks like 0.xxxxenn" # Expected "3.14159265358979323846264338327950288419716939937" =~ /^0\.[0-9]*e[0-9]*$/ to be truthy but was nil fails "BigDecimal#truncate returns Infinity if self is infinite" # ArgumentError: [BigDecimal#fix] wrong number of arguments (given 1, expected 0) fails "BigDecimal#truncate returns NaN if self is NaN" # ArgumentError: [BigDecimal#fix] wrong number of arguments (given 1, expected 0) fails "BigDecimal#truncate returns the same value if self is special value" # Expected FloatDomainError but no exception was raised (NaN was returned) fails "BigDecimal#truncate returns value of given precision otherwise" # ArgumentError: [BigDecimal#fix] wrong number of arguments (given 1, expected 0) fails "BigDecimal#truncate returns value of type Integer." # Expected false == true to be truthy but was false fails "BigDecimal#truncate sets n digits left of the decimal point to 0, if given n < 0" # ArgumentError: [BigDecimal#fix] wrong number of arguments (given 1, expected 0) fails "BigDecimal.double_fig returns the number of digits a Float number is allowed to have" # NoMethodError: undefined method `double_fig' for BigDecimal fails "BigDecimal.limit picks the global precision when limit 0 specified" # Expected 0.8888 == 0.889 to be truthy but was false fails "BigDecimal.limit picks the specified precision over global limit" # Expected 0.888 == 0.89 to be truthy but was false fails "BigDecimal.limit returns the value before set if the passed argument is nil or is not specified" # Expected 1 == 0 to be truthy but was false fails "BigDecimal.limit uses the global limit if no precision is specified" # Expected 0.888 == 0.9 to be truthy but was false fails "BigDecimal.mode raise an exception if the flag is true" # NameError: uninitialized constant BigDecimal::EXCEPTION_NaN fails "BigDecimal.mode returns Infinity when too big" # NameError: uninitialized constant BigDecimal::EXCEPTION_NaN fails "BigDecimal.mode returns the appropriate value and continue the computation if the flag is false" # NameError: uninitialized constant BigDecimal::EXCEPTION_NaN fails "Float#to_d returns appropriate BigDecimal zero for signed zero" # NoMethodError: undefined method `to_d' for -0.0 fails "Kernel#BigDecimal BigDecimal(Rational) with bigger-than-double numerator" # Expected 1000000000000000000 > 18446744073709552000 to be truthy but was false fails "Kernel#BigDecimal accepts significant digits >= given precision" # NoMethodError: undefined method `precs' for 3.1415923 fails "Kernel#BigDecimal allows for [eEdD] as exponent separator" # Exception: new BigNumber() not a number: 12345.67d89 fails "Kernel#BigDecimal coerces the value argument with #to_str" # Exception: new BigNumber() not a number: #<MockObject:0x1bc20> fails "Kernel#BigDecimal creates a new object of class BigDecimal" # Expected 1 == (1/1) to be truthy but was false fails "Kernel#BigDecimal determines precision from initial value" # NoMethodError: undefined method `precs' for 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043 fails "Kernel#BigDecimal does not call to_s when calling inspect" # Expected "44.44" == "0.4444e2" to be truthy but was false fails "Kernel#BigDecimal does not ignores trailing garbage" # Expected ArgumentError but got: Exception (new BigNumber() not a number: 123E45ruby) fails "Kernel#BigDecimal pre-coerces long integers" # Expected 262000 == 1130000000000000 to be truthy but was false fails "Kernel#BigDecimal process underscores as Float()" # Exception: new BigNumber() not a number: 12_345.67E89 fails "Kernel#BigDecimal raises ArgumentError for invalid strings" # Expected ArgumentError but got: Exception (new BigNumber() not a number: ruby) fails "Kernel#BigDecimal raises ArgumentError when Float is used without precision" # Expected ArgumentError but no exception was raised (1 was returned) fails "Kernel#BigDecimal when interacting with Rational BigDecimal maximum precision is nine more than precision except for abnormals" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational BigDecimal precision is the number of digits rounded up to a multiple of nine" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational BigDecimal(Rational, 18) produces the result we expect" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational BigDecimal(Rational, BigDecimal.precs[0]) produces the result we expect" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational has the LHS print as expected" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational has the RHS print as expected" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational has the expected maximum precision on the LHS" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational has the expected precision on the LHS" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational produces a BigDecimal" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational produces the correct class for other arithmetic operators" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational produces the expected result when done via Float" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational produces the expected result when done via to_f" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal when interacting with Rational produces the expected result" # TypeError: Rational can't be coerced into BigDecimal fails "Kernel#BigDecimal with exception: false returns nil for invalid strings" # Exception: new BigNumber() not a number: invalid end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/stringscanner.rb
spec/filters/bugs/stringscanner.rb
# NOTE: run bin/format-filters after changing this file opal_filter "StringScanner" do fails "StringScanner#<< concatenates the given argument to self and returns self" # NoMethodError: undefined method `<<' for #<StringScanner:0xb3490 @string="hello " @pos=0 @matched=nil @working="hello " @match=[]> fails "StringScanner#<< raises a TypeError if the given argument can't be converted to a String" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0xb3488 @string="hello" @pos=0 @matched=nil @working="hello" @match=[]>) fails "StringScanner#<< when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0xb34a4 @string="" @pos=0 @matched=nil @working="" @match=[]>) fails "StringScanner#<< when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0xb34ac @string="hello world" @pos=0 @matched=nil @working="hello world" @match=[]>) fails "StringScanner#[] raises a IndexError when there's no named capture" # Expected IndexError but no exception was raised (nil was returned) fails "StringScanner#[] returns named capture" # Expected nil == "Fri" to be truthy but was false fails "StringScanner#check treats String as the pattern itself" # Expected nil == "This" to be truthy but was false fails "StringScanner#check_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned) fails "StringScanner#clear set the scan pointer to the end of the string and clear matching data." # NoMethodError: undefined method `clear' for #<StringScanner:0xb3478 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#clear warns in verbose mode that the method is obsolete" # NoMethodError: undefined method `clear' for #<StringScanner:0xb346e @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#concat concatenates the given argument to self and returns self" # NoMethodError: undefined method `concat' for #<StringScanner:0x5cc @string="hello " @pos=0 @matched=nil @working="hello " @match=[]> fails "StringScanner#concat raises a TypeError if the given argument can't be converted to a String" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x5c4 @string="hello" @pos=0 @matched=nil @working="hello" @match=[]>) fails "StringScanner#concat when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x5e0 @string="" @pos=0 @matched=nil @working="" @match=[]>) fails "StringScanner#concat when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x5e8 @string="hello world" @pos=0 @matched=nil @working="hello world" @match=[]>) fails "StringScanner#dup copies previous match state" # Expected nil == " " to be truthy but was false fails "StringScanner#empty? returns false if the scan pointer is not at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x6a0 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#empty? returns true if the scan pointer is at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x6a6 @string="This is a test" @pos=14 @matched=nil @working="" @match=nil> fails "StringScanner#empty? warns in verbose mode that the method is obsolete" # NoMethodError: undefined method `empty?' for #<StringScanner:0x696 @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#exist? raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but got: Exception (pattern.exec is not a function) fails "StringScanner#getbyte is not multi-byte character sensitive" # NoMethodError: undefined method `getbyte' for #<StringScanner:0xb3f58 @string="¤¢" @pos=0 @matched=nil @working="¤¢" @match=[]> fails "StringScanner#getbyte returns an instance of String when passed a String subclass" # NoMethodError: undefined method `getbyte' for #<StringScanner:0xb3f46 @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#getbyte returns nil at the end of the string" # NoMethodError: undefined method `getbyte' for #<StringScanner:0xb3f4c @string="" @pos=0 @matched=nil @working="" @match=[]> fails "StringScanner#getbyte scans one byte and returns it" # NoMethodError: undefined method `getbyte' for #<StringScanner:0xb3f52 @string="abc5." @pos=0 @matched=nil @working="abc5." @match=[]> fails "StringScanner#getbyte warns in verbose mode that the method is obsolete" # NoMethodError: undefined method `getbyte' for #<StringScanner:0xb3f5e @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#getch is multi-byte character sensitive" # ArgumentError: unknown encoding name - euc-jp fails "StringScanner#initialize converts the argument into a string using #to_str" # Expected #<MockObject:0xb3788 @name="str", @null=nil> == "test" to be truthy but was false fails "StringScanner#inspect returns a string that represents the StringScanner object" # Expected "#<StringScanner:0x572 @string=\"This is a test\" @pos=0 @matched=nil @working=\"This is a test\" @match=[]>" == "#<StringScanner 0/14 @ \"This ...\">" to be truthy but was false fails "StringScanner#matched returns the last matched string" # Expected nil == "This" to be truthy but was false fails "StringScanner#matched? returns false if there's no match" # NoMethodError: undefined method `matched?' for #<StringScanner:0xb3554 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#matched? returns true if the last match was successful" # NoMethodError: undefined method `matched?' for #<StringScanner:0xb355a @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[] @prev_pos=0> fails "StringScanner#peek raises a ArgumentError when the passed argument is negative" # Expected ArgumentError but no exception was raised ("" was returned) fails "StringScanner#peek raises a RangeError when the passed argument is a Bignum" # Expected RangeError but no exception was raised ("This is a test" was returned) fails "StringScanner#peek returns at most the specified number of bytes from the current position" # Expected "ét" == "é" to be truthy but was false fails "StringScanner#peep raises a ArgumentError when the passed argument is negative" # Expected ArgumentError but got: NoMethodError (undefined method `peep' for #<StringScanner:0xb36ba @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>) fails "StringScanner#peep raises a RangeError when the passed argument is a Bignum" # Expected RangeError but got: NoMethodError (undefined method `peep' for #<StringScanner:0xb36a4 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>) fails "StringScanner#peep returns an empty string when the passed argument is zero" # NoMethodError: undefined method `peep' for #<StringScanner:0xb36ae @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#peep returns an instance of String when passed a String subclass" # NoMethodError: undefined method `peep' for #<StringScanner:0xb36c6 @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#peep returns at most the specified number of bytes from the current position" # NoMethodError: undefined method `peep' for #<StringScanner:0xb36b4 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#peep warns in verbose mode that the method is obsolete" # NoMethodError: undefined method `peep' for #<StringScanner:0xb369a @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#pointer returns 0 in the reset position" # NoMethodError: undefined method `pointer' for #<StringScanner:0xb3618 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#pointer returns the length of the string in the terminate position" # NoMethodError: undefined method `pointer' for #<StringScanner:0xb360e @string="This is a test" @pos=14 @matched=nil @working="" @match=nil> fails "StringScanner#pointer returns the position of the scan pointer" # NoMethodError: undefined method `pointer' for #<StringScanner:0xb3612 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#pointer= modify the scan pointer" # NoMethodError: undefined method `pointer=' for #<StringScanner:0xb3638 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#pointer= positions from the end if the argument is negative" # NoMethodError: undefined method `pointer=' for #<StringScanner:0xb3632 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#pointer= raises a RangeError if position too far backward" # Expected RangeError but got: NoMethodError (undefined method `pointer=' for #<StringScanner:0xb363e @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>) fails "StringScanner#pointer= raises a RangeError when the passed argument is out of range" # Expected RangeError but got: NoMethodError (undefined method `pointer=' for #<StringScanner:0xb3628 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>) fails "StringScanner#pos= raises a RangeError if position too far backward" # Expected RangeError but no exception was raised ("a test" was returned) fails "StringScanner#pos= raises a RangeError when the passed argument is out of range" # Expected RangeError but no exception was raised ("" was returned) fails "StringScanner#restsize is equivalent to rest.size" # NoMethodError: undefined method `restsize' for #<StringScanner:0xb394e @string="This is a test" @pos=4 @matched="This" @working=" is a test" @match=["This"] @prev_pos=0> fails "StringScanner#restsize returns the length of the rest of the string" # NoMethodError: undefined method `restsize' for #<StringScanner:0xb3954 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#restsize warns in verbose mode that the method is obsolete" # NoMethodError: undefined method `restsize' for #<StringScanner:0xb3944 @string="abc" @pos=0 @matched=nil @working="abc" @match=[]> fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp nor String" # Expected TypeError but no exception was raised (nil was returned) fails "StringScanner#scan treats String as the pattern itself" # Expected nil == "This" to be truthy but was false fails "StringScanner#scan with fixed_anchor: true returns the matched string" # ArgumentError: [StringScanner#initialize] wrong number of arguments (given 2, expected 1) fails "StringScanner#scan with fixed_anchor: true treats \\A as matching from the beginning of string" # ArgumentError: [StringScanner#initialize] wrong number of arguments (given 2, expected 1) fails "StringScanner#scan with fixed_anchor: true treats ^ as matching from the beginning of line" # ArgumentError: [StringScanner#initialize] wrong number of arguments (given 2, expected 1) fails "StringScanner#scan_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true" # NoMethodError: undefined method `scan_full' for #<StringScanner:0x472 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#scan_full returns the matched string if the third argument is true" # NoMethodError: undefined method `scan_full' for #<StringScanner:0x484 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#scan_full returns the number of bytes advanced and advances the scan pointer if the second argument is true" # NoMethodError: undefined method `scan_full' for #<StringScanner:0x478 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#scan_full returns the number of bytes advanced" # NoMethodError: undefined method `scan_full' for #<StringScanner:0x47e @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#scan_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned) fails "StringScanner#search_full raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but got: NoMethodError (undefined method `search_full' for #<StringScanner:0xb4016 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>) fails "StringScanner#search_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true" # NoMethodError: undefined method `search_full' for #<StringScanner:0xb4032 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#search_full returns the matched string if the third argument is true" # NoMethodError: undefined method `search_full' for #<StringScanner:0xb4020 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#search_full returns the number of bytes advanced and advances the scan pointer if the second argument is true" # NoMethodError: undefined method `search_full' for #<StringScanner:0xb4026 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#search_full returns the number of bytes advanced" # NoMethodError: undefined method `search_full' for #<StringScanner:0xb402c @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#size returns nil if there is no last match" # NoMethodError: undefined method `size' for #<StringScanner:0x318 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#size returns the number of captures groups of the last match" # NoMethodError: undefined method `size' for #<StringScanner:0x31e @string="This is a test" @pos=3 @matched="Thi" @working="s is a test" @match=["Thi", "T", "h", "i"] @prev_pos=0> fails "StringScanner#skip_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned) fails "StringScanner#string returns the string being scanned" # NoMethodError: undefined method `<<' for #<StringScanner:0x344 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#string= changes the string being scanned to the argument and resets the scanner" # NoMethodError: undefined method `string=' for #<StringScanner:0x360 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]> fails "StringScanner#string= converts the argument into a string using #to_str" # Mock 'str' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "StringScanner#unscan raises a ScanError when the previous match had failed" # NameError: uninitialized constant ScanError fails "StringScanner#unscan set the scan pointer to the previous position" # Expected "This" == nil to be truthy but was false fails "StringScanner.must_C_version returns self" # NoMethodError: undefined method `must_C_version' for StringScanner end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/delegate.rb
spec/filters/bugs/delegate.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Delegate" do fails "Delegator#!= is delegated in general" # Exception: Maximum call stack size exceeded fails "Delegator#== is delegated in general" # Exception: Maximum call stack size exceeded end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/hash.rb
spec/filters/bugs/hash.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Hash" do fails "Hash#== compares keys with eql? semantics" # Expected true to be false fails "Hash#== computes equality for complex recursive hashes" # Exception: Maximum call stack size exceeded fails "Hash#== computes equality for recursive hashes & arrays" # Exception: Maximum call stack size exceeded fails "Hash#[] compares keys with eql? semantics" # Expected "x" == nil to be truthy but was false fails "Hash#[] does not create copies of the immediate default value" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "Hash#[] does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6576> fails "Hash#[]= does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7e042 @method="[]=" @object=nil> fails "Hash#[]= keeps the existing String key in the hash if there is a matching one" # Expected "foo" not to be identical to "foo" fails "Hash#compare_by_identity gives different identity for string literals" # Expected [2] == [1, 2] to be truthy but was false fails "Hash#each always yields an Array of 2 elements, even when given a callable of arity 2" # Expected ArgumentError but no exception was raised ({"a"=>1} was returned) fails "Hash#each_pair always yields an Array of 2 elements, even when given a callable of arity 2" # Expected ArgumentError but no exception was raised ({"a"=>1} was returned) fails "Hash#eql? compares keys with eql? semantics" # Expected true to be false fails "Hash#eql? computes equality for complex recursive hashes" # Exception: Maximum call stack size exceeded fails "Hash#eql? computes equality for recursive hashes & arrays" # Exception: Maximum call stack size exceeded fails "Hash#except always returns a Hash without a default" # Expected #<Class:0x8666> == Hash to be truthy but was false fails "Hash#inspect calls #to_s on the object returned from #inspect if the Object isn't a String" # Expected "{\"a\"=>abc}" == "{:a=>abc}" to be truthy but was false fails "Hash#inspect does not call #to_s on a String returned from #inspect" # Expected "{\"a\"=>\"abc\"}" == "{:a=>\"abc\"}" to be truthy but was false fails "Hash#inspect does not call #to_str on the object returned from #inspect when it is not a String" # Expected "{\"a\"=>#<MockObject:0x40e02>}" =~ /^\{:a=>#<MockObject:0x[0-9a-f]+>\}$/ to be truthy but was nil fails "Hash#inspect does not call #to_str on the object returned from #to_s when it is not a String" # Exception: Cannot convert object to primitive value fails "Hash#invert compares new keys with eql? semantics" # Expected "b" == "a" to be truthy but was false fails "Hash#store does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x627dc @method="store" @object=nil> fails "Hash#store keeps the existing String key in the hash if there is a matching one" # Expected "foo" not to be identical to "foo" fails "Hash#to_proc the returned proc has an arity of 1" # Expected -1 == 1 to be truthy but was false fails "Hash#to_proc the returned proc is a lambda" # Expected #<Proc:0x42df6>.lambda? to be truthy but was false fails "Hash#to_s calls #to_s on the object returned from #inspect if the Object isn't a String" # Expected "{\"a\"=>abc}" == "{:a=>abc}" to be truthy but was false fails "Hash#to_s does not call #to_s on a String returned from #inspect" # Expected "{\"a\"=>\"abc\"}" == "{:a=>\"abc\"}" to be truthy but was false fails "Hash#to_s does not call #to_str on the object returned from #inspect when it is not a String" # Expected "{\"a\"=>#<MockObject:0xb4f9a>}" =~ /^\{:a=>#<MockObject:0x[0-9a-f]+>\}$/ to be truthy but was nil fails "Hash#to_s does not call #to_str on the object returned from #to_s when it is not a String" # Exception: Cannot convert object to primitive value fails "Hash.ruby2_keywords_hash copies instance variables" # Expected nil == 42 to be truthy but was false fails "Hash.ruby2_keywords_hash raises TypeError for non-Hash" # Expected TypeError but no exception was raised (nil was returned) fails "Hash.ruby2_keywords_hash returns a copy of a Hash and marks the copy as a keywords Hash" # Expected false == true to be truthy but was false 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 fails "Hash.ruby2_keywords_hash? raises TypeError for non-Hash" # Expected TypeError but no exception was raised (false was returned) 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 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)) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/singleton.rb
spec/filters/bugs/singleton.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Singleton" do fails "Singleton._load returns the singleton instance for anything passed in to subclass" # NoMethodError: undefined method `_load' for SingletonSpecs::MyClassChild fails "Singleton._load returns the singleton instance for anything passed in" # NoMethodError: undefined method `_load' for SingletonSpecs::MyClass end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/date.rb
spec/filters/bugs/date.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Date" do 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 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) 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 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> 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> fails "Date#commercial creates a Date for Julian Day Number day 0 by default" # NoMethodError: undefined method `commercial' for Date fails "Date#commercial creates a Date for the correct day given the year, week and day number" # NoMethodError: undefined method `commercial' for Date fails "Date#commercial creates a Date for the monday in the year and week given" # NoMethodError: undefined method `commercial' for Date fails "Date#commercial creates only Date objects for valid weeks" # Expected ArgumentError but got: NoMethodError (undefined method `commercial' for Date) fails "Date#cwyear determines the commercial year" # NoMethodError: undefined method `cwyear' for #<Date:0x9f61a @date=2007-01-17 00:00:00 +0100 @start=2299161> fails "Date#day_fraction determines the day fraction" # NoMethodError: undefined method `day_fraction' for #<Date:0x9f5c4 @date=2007-01-17 00:00:00 +0100 @start=2299161> fails "Date#england converts a date object into another with the English calendar reform" # NoMethodError: undefined method `england' for #<Date:0x74ac6 @date=1582-10-15 00:00:00 +0124 @start=2299161> fails "Date#gregorian converts a date object into another with the Gregorian calendar" # NoMethodError: undefined method `gregorian' for #<Date:0x74ada @date=1582-10-04 00:00:00 +0124 @start=2299161> fails "Date#gregorian? marks a day after the calendar reform as Julian" # NoMethodError: undefined method `gregorian?' for #<Date:0x54cc @date=2007-02-27 00:00:00 +0100 @start=2299161> fails "Date#gregorian? marks a day before the calendar reform as Julian" # NoMethodError: undefined method `gregorian?' for #<Date:0x54d4 @date=1007-02-27 00:00:00 +0124 @start=2299161> fails "Date#hash returns the same value for equal dates" # Expected 624408 == 624412 to be truthy but was false fails "Date#italy converts a date object into another with the Italian calendar reform" # NoMethodError: undefined method `italy' for #<Date:0x74abc @date=1582-10-04 00:00:00 +0124 @start=2361222> fails "Date#julian converts a date object into another with the Julian calendar" # NoMethodError: undefined method `julian' for #<Date:0x74ad0 @date=1582-10-15 00:00:00 +0124 @start=2299161> fails "Date#julian? marks a day before the calendar reform as Julian" # Expected false to be true fails "Date#ld determines the Modified Julian day" # NoMethodError: undefined method `ld' for #<Date:0x9f5d8 @date=2007-01-17 00:00:00 +0100 @start=2299161> fails "Date#mjd determines the Modified Julian day" # NoMethodError: undefined method `mjd' for #<Date:0x9f5ce @date=2007-01-17 00:00:00 +0100 @start=2299161> fails "Date#new_start converts a date object into another with a new calendar reform" # ArgumentError: [Date#new_start] wrong number of arguments (given 0, expected 1) fails "Date#parse coerces using to_str" # ArgumentError: invalid date fails "Date#parse parses a day name into a Date object" # NoMethodError: undefined method `cwyear' for #<Date:0x9fddc @start=2299161 @date=2022-12-09 00:00:00 +0100> fails "Date#parse parses a month day into a Date object" # ArgumentError: invalid date fails "Date#parse parses a month name into a Date object" # ArgumentError: invalid date fails "Date#parse raises a TypeError trying to parse non-String-like object" # Expected TypeError but got: ArgumentError (invalid date) fails "Date#strftime should be able to print the commercial year with leading zeroes" # Expected "200" == "0200" to be truthy but was false fails "Date#strftime should be able to print the commercial year with only two digits" # TypeError: no implicit conversion of Range into Integer 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 fails "Date#strftime should be able to show the commercial week day" # Expected "1" == "7" to be truthy but was false fails "Date#strftime should be able to show the commercial week" # Expected " 9-APR-2000" == " 9-Apr-2000" to be truthy but was false 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 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 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 fails "Date#strftime should be able to show the week number with the week starting on Sunday (%U) and Monday (%W)" # Expected "%U" == "14" to be truthy but was false fails "Date#strftime shows the number of milliseconds since epoch" # Expected "%Q" == "0" to be truthy but was false fails "Date#strptime parses a century" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a commercial week day" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a commercial week" # NoMethodError: undefined method `cwyear' for #<Date:0x6b2 @start=2299161 @date=2022-12-07 05:15:38 +0100> fails "Date#strptime parses a commercial year with leading zeroes" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a commercial year with only two digits" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a date given MM/DD/YY" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a date given as YYYY-MM-DD" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a date given in full notation" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a date with slashes" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a full date" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a full day name" # NoMethodError: undefined method `cwyear' for #<Date:0x6e6 @start=2299161 @date=2022-12-07 05:15:38 +0100> fails "Date#strptime parses a full month name" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a month day with leading spaces" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a month day with leading zeroes" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a month with leading zeroes" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a short day name" # NoMethodError: undefined method `cwyear' for #<Date:0x6b8 @start=2299161 @date=2022-12-07 05:15:38 +0100> fails "Date#strptime parses a short month name" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a week day" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a week number for a week starting on Monday" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a week number for a week starting on Sunday" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a year day with leading zeroes" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a year in YY format" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime parses a year in YYYY format" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime returns January 1, 4713 BCE when given no arguments" # NoMethodError: undefined method `strptime' for Date fails "Date#strptime uses the default format when not given a date format" # NoMethodError: undefined method `strptime' for Date fails "Date#valid_civil? handles negative months and days" # NoMethodError: undefined method `valid_civil?' for Date fails "Date#valid_civil? returns false if it is not a valid civil date" # NoMethodError: undefined method `valid_civil?' for Date fails "Date#valid_civil? returns true if it is a valid civil date" # NoMethodError: undefined method `valid_civil?' for Date fails "Date#valid_commercial? handles negative week and day numbers" # NoMethodError: undefined method `valid_commercial?' for Date fails "Date#valid_commercial? returns false it is not a valid commercial date" # NoMethodError: undefined method `valid_commercial?' for Date fails "Date#valid_commercial? returns true if it is a valid commercial date" # NoMethodError: undefined method `valid_commercial?' for Date fails "Date#valid_date? handles negative months and days" # NoMethodError: undefined method `valid_date?' for Date fails "Date#valid_date? returns false if it is not a valid civil date" # NoMethodError: undefined method `valid_date?' for Date fails "Date#valid_date? returns true if it is a valid civil date" # NoMethodError: undefined method `valid_date?' for Date fails "Date._iso8601 returns an empty hash if the argument is a invalid Date" # NoMethodError: undefined method `_iso8601' for Date fails "Date._rfc3339 returns an empty hash if the argument is a invalid Date" # NoMethodError: undefined method `_rfc3339' for Date fails "Date.civil creates a Date for different calendar reform dates" # Expected 5 == 15 to be truthy but was false 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) fails "Date.iso8601 parses YYYY-MM-DD into a Date object" # NoMethodError: undefined method `iso8601' for Date fails "Date.iso8601 parses YYYYMMDD into a Date object" # NoMethodError: undefined method `iso8601' for Date fails "Date.iso8601 parses a StringSubclass into a Date object" # NoMethodError: undefined method `iso8601' for Date fails "Date.iso8601 parses a negative Date" # NoMethodError: undefined method `iso8601' for Date fails "Date.iso8601 raises a TypeError when passed an Object" # Expected TypeError but got: NoMethodError (undefined method `iso8601' for Date) fails "Date.jd constructs a Date object if passed a Julian day" # NoMethodError: undefined method `jd' for Date fails "Date.jd constructs a Date object if passed a negative number" # NoMethodError: undefined method `jd' for Date fails "Date.jd returns a Date object representing Julian day 0 (-4712-01-01) if no arguments passed" # NoMethodError: undefined method `jd' for Date fails "Date.julian_leap? determines whether a year is a leap year in the Julian calendar" # NoMethodError: undefined method `julian_leap?' for Date fails "Date.julian_leap? determines whether a year is not a leap year in the Julian calendar" # NoMethodError: undefined method `julian_leap?' for Date fails "Date.new creates a Date for different calendar reform dates" # Expected 5 == 15 to be truthy but was false fails "Date.new doesn't create dates for invalid arguments" # Expected ArgumentError but no exception was raised (#<Date:0x48b08 @date=2001-01-31 00:00:00 +0100, @start=2299161> was returned) fails "Date.ordinal constructs a Date object from an ordinal date" # NoMethodError: undefined method `ordinal' for Date fails "Date.valid_jd? returns false if passed false" # NoMethodError: undefined method `valid_jd?' for Date fails "Date.valid_jd? returns false if passed nil" # NoMethodError: undefined method `valid_jd?' for Date fails "Date.valid_jd? returns false if passed symbol" # NoMethodError: undefined method `valid_jd?' for Date fails "Date.valid_jd? returns true if passed a number value" # NoMethodError: undefined method `valid_jd?' for Date fails "Date.valid_ordinal? determines if the date is a valid ordinal date" # NoMethodError: undefined method `valid_ordinal?' for Date fails "Date.valid_ordinal? handles negative day numbers" # NoMethodError: undefined method `valid_ordinal?' for Date end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/symbol.rb
spec/filters/bugs/symbol.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Symbol" do fails "Symbol#to_proc produces a Proc that always returns [[:req], [:rest]] for #parameters" # Expected [["rest", "args"], ["block", "block"]] == [["req"], ["rest"]] to be truthy but was false fails "Symbol#to_proc produces a Proc with arity -2" # Expected -1 == -2 to be truthy but was false fails "Symbol#to_proc returns a Proc with #lambda? true" # Expected #<Proc:0x45a30>.lambda? to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/bugs/numeric.rb
spec/filters/bugs/numeric.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Numeric" do fails "Numeric#clone does not change frozen status" # Expected false == true to be truthy but was false fails "Numeric#clone raises ArgumentError if passed freeze: false" # Expected ArgumentError (/can't unfreeze/) but no exception was raised (1 was returned) fails "Numeric#dup does not change frozen status" # Expected false == true to be truthy but was false fails "Numeric#remainder returns the result of calling self#% with other - other if self is greater than 0 and other is less than 0" # Mock '#<NumericSpecs::Subclass:0x5c1ee>' expected to receive %(#<MockObject:0x5c1f2 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times fails "Numeric#remainder returns the result of calling self#% with other - other if self is less than 0 and other is greater than 0" # Mock '#<NumericSpecs::Subclass:0x5c182>' expected to receive %(#<MockObject:0x5c186 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times fails "Numeric#remainder returns the result of calling self#% with other if self and other are greater than 0" # Mock '#<NumericSpecs::Subclass:0x5c1d0>' expected to receive %(#<MockObject:0x5c1d4 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times fails "Numeric#remainder returns the result of calling self#% with other if self and other are less than 0" # Mock '#<NumericSpecs::Subclass:0x5c1a0>' expected to receive %(#<MockObject:0x5c1a4 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times fails "Numeric#remainder returns the result of calling self#% with other if self is 0" # Mock '#<NumericSpecs::Subclass:0x5c1be>' expected to receive %(#<MockObject:0x5c1c2 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times fails "Numeric#singleton_method_added raises a TypeError when trying to define a singleton method on a Numeric" # Expected TypeError but no exception was raised ("test" was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/float.rb
spec/filters/platform/bun/float.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Float" do fails "Float#fdiv performs floating-point division between self and an Integer" # Expected 8.900000000008007e-117 == 8.900000000008011e-117 to be truthy but was false fails "Float#quo performs floating-point division between self and an Integer" # Expected 8.900000000008007e-117 == 8.900000000008011e-117 to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/kernel.rb
spec/filters/platform/bun/kernel.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Kernel" do fails "Kernel#caller includes core library methods defined in Ruby" fails "Kernel#object_id returns the same value for two Symbol literals" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/freeze.rb
spec/filters/platform/bun/freeze.rb
# NOTE: run bin/format-filters after changing this file opal_filter "freezing" do fails "Kernel#freeze on a Float has no effect since it is already frozen" # Expected false to be true fails "Kernel#freeze on integers has no effect since they are already frozen" # Expected false to be true fails "Kernel#freeze on true, false and nil has no effect since they are already frozen" # Expected false to be true fails "Kernel#frozen? on a Float returns true" # Expected false to be true fails "Kernel#frozen? on integers returns true" # Expected false to be true fails "Kernel#frozen? on true, false and nil returns true" # Expected false to be true end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/literal_regexp.rb
spec/filters/platform/bun/literal_regexp.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Literal Regexp" do fails "Literal Regexps handles a lookbehind with ss characters" fails "Literal Regexps supports (?<! ) (negative lookbehind)" fails "Literal Regexps supports (?<= ) (positive lookbehind)" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/exception.rb
spec/filters/platform/bun/exception.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Exception" do fails "Exception#backtrace contains lines of the same format for each prior position in the stack" fails "Exception#backtrace returns an Array that can be updated" fails "Exception#backtrace returns the same array after duping" fails "Exception#backtrace sets each element to a String" fails "Exception#backtrace_locations sets each element to a Thread::Backtrace::Location" fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NameError" fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NoMethodError" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/bun/symbol.rb
spec/filters/platform/bun/symbol.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Symbol" do fails "BasicObject#__id__ returns the same value for two Symbol literals" # end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/safari/float.rb
spec/filters/platform/safari/float.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Float" do fails "Float#fdiv performs floating-point division between self and an Integer" # Expected 8.900000000008007e-117 == 8.900000000008011e-117 to be truthy but was false fails "Float#quo performs floating-point division between self and an Integer" # Expected 8.900000000008007e-117 == 8.900000000008011e-117 to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/safari/kernel.rb
spec/filters/platform/safari/kernel.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Kernel" do fails "Kernel#caller includes core library methods defined in Ruby" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/safari/literal_regexp.rb
spec/filters/platform/safari/literal_regexp.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Literal Regexp" do fails "Literal Regexps handles a lookbehind with ss characters" fails "Literal Regexps supports (?<! ) (negative lookbehind)" fails "Literal Regexps supports (?<= ) (positive lookbehind)" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/safari/exception.rb
spec/filters/platform/safari/exception.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Exception" do fails "Exception#backtrace contains lines of the same format for each prior position in the stack" fails "Exception#backtrace returns an Array that can be updated" fails "Exception#backtrace returns the same array after duping" fails "Exception#backtrace sets each element to a String" fails "Exception#backtrace_locations sets each element to a Thread::Backtrace::Location" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/firefox/kernel.rb
spec/filters/platform/firefox/kernel.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Kernel" do fails "Kernel#caller includes core library methods defined in Ruby" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/firefox/exception.rb
spec/filters/platform/firefox/exception.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Exception" do fails "Exception#backtrace contains lines of the same format for each prior position in the stack" fails "Exception#backtrace sets each element to a String" fails "Exception#backtrace_locations sets each element to a Thread::Backtrace::Location" fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NameError" fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NoMethodError" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/array.rb
spec/filters/platform/deno/array.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Array" do fails "Array#inspect does not call #to_s on a String returned from #inspect" # Exception: Cannot create property '$$meta' on string 'abc' fails "Array#join uses the widest common encoding when other strings are incompatible" # FrozenError: can't modify frozen String fails "Array#to_s does not call #to_s on a String returned from #inspect" # Exception: Cannot create property '$$meta' on string 'abc' end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/time.rb
spec/filters/platform/deno/time.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Time" do fails "Time.at passed [Time, Numeric, format] not supported format does not try to convert format to Symbol with #to_sym" # Exception: Cannot create property '$$meta' on string 'usec' end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/file.rb
spec/filters/platform/deno/file.rb
# NOTE: run bin/format-filters after changing this file opal_filter "File" do fails "File.expand_path when HOME is set does not return a frozen string" # Expected "/rubyspec_home".frozen? to be falsy but was true fails "File.extname returns unfrozen strings" # Expected true == false to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/binding.rb
spec/filters/platform/deno/binding.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Binding" do fails "Binding#local_variable_get reads variables added later to the binding" # Exception: a is not defined fails "Binding#local_variable_set overwrites a local variable defined using eval()" # Exception: number is not defined fails "Binding#local_variable_set scopes new local variables to the receiving Binding" # Exception: number is not defined fails "Binding#local_variable_set sets a local variable using a String as the variable name" # Exception: number is not defined fails "Binding#local_variable_set sets a new local variable" # Exception: number is not defined end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/kernel.rb
spec/filters/platform/deno/kernel.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Kernel" do fails "Kernel#Float converts Strings to floats without calling #to_f" # Exception: Cannot create property '$$meta' on string '10' fails "Kernel#String returns the same object if it is already a String" # Exception: Cannot create property '$$meta' on string 'Hello' fails "Kernel#caller includes core library methods defined in Ruby" # Expected "file:///var/folders/lj/_64stkl97_x2wy7w567j8m5m0000gn/T/opal-system-runner20241010-53720-6w8bh1.js:1715:14:in `Object.Opal.yield1'".end_with? "in `tap'" to be truthy but was false fails "Kernel#clone with freeze: nil copies frozen?" # Expected false to be true fails "Kernel#clone with no arguments copies frozen?" # Expected false to be true fails "Kernel#sprintf returns a String in the argument's encoding if format encoding is more restrictive" # FrozenError: can't modify frozen String fails "Kernel.Float converts Strings to floats without calling #to_f" # Exception: Cannot create property '$$meta' on string '10' fails "Kernel.String returns the same object if it is already a String" # Exception: Cannot create property '$$meta' on string 'Hello' fails "Kernel.sprintf returns a String in the argument's encoding if format encoding is more restrictive" # FrozenError: can't modify frozen String end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/exception.rb
spec/filters/platform/deno/exception.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Exception" do fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NameError" # Expected "file:///var/folders/lj/_64stkl97_x2wy7w567j8m5m0000gn/T/opal-system-runner20241010-53720-6w8bh1.js:1563:35:in `klass.method_missing_stub'" not to include "method_missing" fails "Invoking a method when the method is not available should omit the method_missing call from the backtrace for NoMethodError" # Expected "file:///var/folders/lj/_64stkl97_x2wy7w567j8m5m0000gn/T/opal-system-runner20241010-53720-6w8bh1.js:1563:35:in `klass.method_missing_stub'" not to include "method_missing" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/string.rb
spec/filters/platform/deno/string.rb
# NOTE: run bin/format-filters after changing this file opal_filter "String" do fails "A singleton class has class String as the superclass of a String instance" # Exception: Cannot create property '$$meta' on string 'blah' fails "Ruby String interpolation creates a non-frozen String when # frozen-string-literal: true is used" # Expected "a42c".frozen? to be falsy but was true fails "Ruby String interpolation creates a non-frozen String" # Expected "a42c".frozen? to be falsy but was true fails "SimpleDelegator can be marshalled with its instance variables intact" # Exception: Cannot create property '$$meta' on string '__v2__' fails "String#% returns a String in the argument's encoding if format encoding is more restrictive" # FrozenError: can't modify frozen String fails "String#<=> with String ignores encoding difference" # FrozenError: can't modify frozen String fails "String#<=> with String returns 0 when comparing 2 empty strings but one is not ASCII-compatible" # FrozenError: can't modify frozen String fails "String#<=> with String returns 0 with identical ASCII-compatible bytes of different encodings" # FrozenError: can't modify frozen String fails "String#[] with index, length returns a string with the same encoding as self" # FrozenError: can't modify frozen String fails "String#ascii_only? returns false for a non-empty String with non-ASCII-compatible encoding" # FrozenError: can't modify frozen String fails "String#ascii_only? returns false for the empty String with a non-ASCII-compatible encoding" # FrozenError: can't modify frozen String fails "String#ascii_only? returns false when interpolating non ascii strings" # FrozenError: can't modify frozen String fails "String#ascii_only? with ASCII only characters returns true if the encoding is US-ASCII" # FrozenError: can't modify frozen String fails "String#ascii_only? with non-ASCII only characters returns false if the encoding is US-ASCII" # FrozenError: can't modify frozen String fails "String#b returns a binary encoded string" # FrozenError: can't modify frozen String fails "String#byteindex with String handles a substring in a subset encoding" # FrozenError: can't modify frozen String fails "String#byteindex with String handles a substring in a superset encoding" # FrozenError: can't modify frozen String fails "String#byterindex with String handles a substring in a subset encoding" # FrozenError: can't modify frozen String fails "String#byterindex with String handles a substring in a superset encoding" # FrozenError: can't modify frozen String fails "String#bytes is unaffected by #force_encoding" # FrozenError: can't modify frozen String fails "String#bytesize returns 0 for the empty string" # FrozenError: can't modify frozen String fails "String#bytesize works with pseudo-ASCII strings containing UTF-8 characters" # FrozenError: can't modify frozen String fails "String#bytesize works with pseudo-ASCII strings containing single UTF-8 characters" # FrozenError: can't modify frozen String fails "String#byteslice with index, length returns a string with the same encoding as self" # FrozenError: can't modify frozen String fails "String#capitalize returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#casecmp independent of case returns 0 for empty strings in different encodings" # FrozenError: can't modify frozen String fails "String#casecmp? independent of case returns true for empty strings in different encodings" # FrozenError: can't modify frozen String fails "String#center with length, padding with width returns a String in the same encoding as the original" # FrozenError: can't modify frozen String fails "String#chars returns characters in the same encoding as self" # FrozenError: can't modify frozen String fails "String#chomp removes the final carriage return, newline from a non-ASCII String when the record separator is changed" # FrozenError: can't modify frozen String fails "String#chomp removes the final carriage return, newline from a non-ASCII String" # FrozenError: can't modify frozen String fails "String#chomp when passed no argument returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#chop removes the final carriage return, newline from a non-ASCII String" # FrozenError: can't modify frozen String fails "String#chop returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#chr returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#clone copies frozen state" # Expected false to be true fails "String#delete returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#delete_prefix returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#delete_suffix returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#downcase returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#dump does not take into account if a string is frozen" # Expected "\"foo\"".frozen? to be falsy but was true fails "String#dump returns a string with non-printing ASCII characters replaced by \\x notation" # FrozenError: can't modify frozen String fails "String#each_char returns characters in the same encoding as self" # FrozenError: can't modify frozen String fails "String#each_grapheme_cluster returns characters in the same encoding as self" # FrozenError: can't modify frozen String fails "String#each_line returns Strings in the same encoding as self" # FrozenError: can't modify frozen String fails "String#encode when passed no options encodes an ascii substring of a binary string to UTF-8" # FrozenError: can't modify frozen String fails "String#encode when passed to encoding round trips a String" # FrozenError: can't modify frozen String fails "String#encoding for Strings with \\u escapes returns the given encoding if #force_encoding has been called" # FrozenError: can't modify frozen String fails "String#encoding returns the given encoding if #force_encoding has been called" # FrozenError: can't modify frozen String fails "String#force_encoding accepts a String as the name of an Encoding" # FrozenError: can't modify frozen String fails "String#force_encoding accepts an Encoding instance" # FrozenError: can't modify frozen String fails "String#grapheme_clusters returns characters in the same encoding as self" # FrozenError: can't modify frozen String fails "String#gsub with pattern and replacement handles a pattern in a subset encoding" # FrozenError: can't modify frozen String fails "String#include? with String returns true if both strings are empty" # FrozenError: can't modify frozen String fails "String#include? with String returns true if the RHS is empty" # FrozenError: can't modify frozen String fails "String#index with String handles a substring in a subset encoding" # FrozenError: can't modify frozen String fails "String#index with String handles a substring in a superset encoding" # FrozenError: can't modify frozen String fails "String#lines returns Strings in the same encoding as self" # FrozenError: can't modify frozen String fails "String#ljust with length, padding with width returns a String in the same encoding as the original" # FrozenError: can't modify frozen String fails "String#ljust with length, padding with width, pattern returns a String in the compatible encoding" # FrozenError: can't modify frozen String fails "String#next adds an additional character (just left to the last increased one) if there is a carry and no character left to increase" # FrozenError: can't modify frozen String fails "String#next increases non-alphanumerics (via ascii rules) if there are no alphanumerics" # FrozenError: can't modify frozen String fails "String#next increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry" # FrozenError: can't modify frozen String fails "String#next increases the next best character if there is a carry for non-alphanumerics" # FrozenError: can't modify frozen String fails "String#next returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#next returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)" # FrozenError: can't modify frozen String fails "String#partition with String handles a pattern in a subset encoding" # FrozenError: can't modify frozen String fails "String#partition with String returns before- and after- parts in the same encoding as self" # FrozenError: can't modify frozen String fails "String#partition with String returns the matching part in the separator's encoding" # FrozenError: can't modify frozen String fails "String#reverse returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#rindex with String handles a substring in a subset encoding" # FrozenError: can't modify frozen String fails "String#rindex with String handles a substring in a superset encoding" # FrozenError: can't modify frozen String fails "String#rjust with length, padding with width returns a String in the same encoding as the original" # FrozenError: can't modify frozen String fails "String#rjust with length, padding with width, pattern returns a String in the compatible encoding" # FrozenError: can't modify frozen String fails "String#rpartition with String handles a pattern in a subset encoding" # FrozenError: can't modify frozen String fails "String#rpartition with String returns before- and after- parts in the same encoding as self" # FrozenError: can't modify frozen String fails "String#rpartition with String returns the matching part in the separator's encoding" # FrozenError: can't modify frozen String fails "String#rstrip returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#scan returns Strings in the same encoding as self" # FrozenError: can't modify frozen String fails "String#scrub with a default replacement returns a copy of self when the input encoding is BINARY" # FrozenError: can't modify frozen String fails "String#slice with index, length returns a string with the same encoding as self" # FrozenError: can't modify frozen String fails "String#split with Regexp returns Strings in the same encoding as self" # FrozenError: can't modify frozen String fails "String#split with String returns Strings in the same encoding as self" # FrozenError: can't modify frozen String fails "String#squeeze negates sets starting with ^" # FrozenError: can't modify frozen String fails "String#squeeze only squeezes chars that are in the intersection of all sets given" # FrozenError: can't modify frozen String fails "String#squeeze returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#squeeze returns new string where runs of the same character are replaced by a single character when no args are given" # FrozenError: can't modify frozen String fails "String#squeeze squeezes all chars in a sequence" # FrozenError: can't modify frozen String fails "String#squeeze tries to convert each set arg to a string using to_str" # FrozenError: can't modify frozen String fails "String#strip returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#sub with pattern, replacement handles a pattern in a subset encoding" # FrozenError: can't modify frozen String fails "String#succ adds an additional character (just left to the last increased one) if there is a carry and no character left to increase" # FrozenError: can't modify frozen String fails "String#succ increases non-alphanumerics (via ascii rules) if there are no alphanumerics" # FrozenError: can't modify frozen String fails "String#succ increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry" # FrozenError: can't modify frozen String fails "String#succ increases the next best character if there is a carry for non-alphanumerics" # FrozenError: can't modify frozen String fails "String#succ returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#succ returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)" # FrozenError: can't modify frozen String fails "String#swapcase returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#upcase returns a String in the same encoding as self" # FrozenError: can't modify frozen String fails "String#valid_encoding? returns false if self is valid in one encoding, but invalid in the one it's tagged with" # FrozenError: can't modify frozen String fails "String#valid_encoding? returns true if self is valid in the current encoding and other encodings" # FrozenError: can't modify frozen String end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/platform/deno/marshal.rb
spec/filters/platform/deno/marshal.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Marshal" do fails "Marshal.dump Random returns a binary string" # Exception: Cannot create property '$$meta' on string 'Error when building Random marshal data undefined method `binread' for File' fails "Marshal.dump String big returns a binary string" # Exception: Cannot create property '$$meta' on string 'bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig' fails "Marshal.dump Symbol big returns a binary string" # Exception: Cannot create property '$$meta' on string 'bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig' fails "Marshal.dump Symbol returns a binary string" # Exception: Cannot create property '$$meta' on string 'symbol' fails "Marshal.dump Symbol small returns a binary string" # Exception: Cannot create property '$$meta' on string 'big' fails "Marshal.dump _dump object extended returns a binary string" # Exception: Cannot create property '$$meta' on string 'stuff' fails "Marshal.dump _dump object returns a binary string" # Exception: Cannot create property '$$meta' on string 'stuff' fails "Marshal.dump marshal_dump object returns a binary string" # Exception: Cannot create property '$$meta' on string 'data' fails "Marshal.dump with a Class dumps a class with multibyte characters in name" # NameError: uninitialized constant MarshalSpec::MultibyteããããClass fails "Marshal.dump with a Module dumps a module with multibyte characters in name" # NameError: uninitialized constant MarshalSpec::MultibyteããããModule fails "Marshal.dump with a String dumps a long String" # FrozenError: can't modify frozen String fails "Marshal.dump with a Struct dumps a Struct with instance variables" # FrozenError: can't modify frozen String fails "Marshal.dump with a Struct dumps a Struct" # NameError: uninitialized constant Struct::Pyramid fails "Marshal.dump with an object responding to #marshal_dump does not use Class#name" # Exception: Cannot create property '$$meta' on string 'data' fails "Marshal.load for a Hash allocates an instance of the proper class when Hash subclass with compare_by_identity behaviour" # Exception: Cannot create property '$$meta' on string 'a' fails "Marshal.load loads a String extended" # Exception: Cannot create property '$$meta' on string '' fails "Marshal.load raises an ArgumentError when the dumped data is truncated" # Expected ArgumentError (marshal data too short) but got: Exception (Cannot create property '$$meta' on string 'first') end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/language.rb
spec/filters/unsupported/language.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "language" do fails "Ruby String literals with a magic frozen comment produce different objects for literals with the same content in different files if the other file doesn't have the comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x14b20 @ip="xxx" @my_ip="xxx"> fails "Ruby String literals with a magic frozen comment produce different objects for literals with the same content in different files if they have different encodings" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x14b20 @ip="xxx" @my_ip="xxx"> fails "Ruby String literals with a magic frozen comment produce the same object each time" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x14b20 @ip="xxx" @my_ip="xxx"> fails "Ruby String literals with a magic frozen comment produce the same object for literals with the same content in different files" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x14b20 @ip="xxx" @my_ip="xxx"> fails "Ruby String literals with a magic frozen comment produce the same object for literals with the same content" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x14b20 @ip="xxx" @my_ip="xxx"> fails "The defined? keyword for pseudo-variables returns 'expression' for __ENCODING__" # Expected "constant" == "expression" to be truthy but was false fails "The defined? keyword when called with a method name having a module as receiver returns nil if the method is private" # Expected "method" to be nil fails "The private keyword changes the visibility of the existing method in the subclass" # Expected NoMethodError but no exception was raised ("foo" was returned) fails "The private keyword changes visibility of previously called method" # Expected NoMethodError but no exception was raised ("foo" was returned) fails "The private keyword changes visibility of previously called methods with same send/call site" # Expected NoMethodError but no exception was raised (2 was returned) fails "The private keyword is overridden when a new class is opened" # Expected NoMethodError but no exception was raised (1 was returned) fails "The private keyword marks following methods as being private" # Expected ["foo", "bar", "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", "unpack_format", "be_close_to_matrix", "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", "check_autoload", "example_instance_method_of_object", "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?", "respond_to_missing?", "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", "method_missing"] not to include "bar" fails "rescuing Interrupt raises an Interrupt when sent a signal SIGINT" # NoMethodError: undefined method `kill' for Process fails "rescuing SignalException raises a SignalException when sent a signal" # NoMethodError: undefined method `kill' for Process end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/range.rb
spec/filters/unsupported/range.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Range" do fails "Range#initialize is private" # Expected Range to have private instance method 'initialize' but it does not end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/thread.rb
spec/filters/unsupported/thread.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Thread" do fails "The return keyword in a Thread raises a LocalJumpError if used to exit a thread" # NotImplementedError: Thread creation not available end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/struct.rb
spec/filters/unsupported/struct.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Struct" do fails "Struct#initialize is private" # Expected StructClasses::Car to have private instance method 'initialize' but it does not fails "Struct.new does not create a constant with symbol as first argument" # Expected true to be false fails "Struct.new fails with invalid constant name as first argument" # Expected NameError but no exception was raised (#<Class:0xa4f0> was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/basicobject.rb
spec/filters/unsupported/basicobject.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "BasicObject" do fails "BasicObject#method_missing for a Class raises a NoMethodError when a private method is called" # Expected NoMethodError but no exception was raised ("class_private_method" was returned) fails "BasicObject#method_missing for a Class raises a NoMethodError when a protected method is called" # Expected NoMethodError but no exception was raised ("class_private_method" was returned) fails "BasicObject#method_missing for a Class with #method_missing defined is called when an private method is called" # Expected "class_private_method" == "class_method_missing" to be truthy but was false fails "BasicObject#method_missing for a Class with #method_missing defined is called when an protected method is called" # Expected "class_private_method" == "class_method_missing" to be truthy but was false fails "BasicObject#method_missing for a Module raises a NoMethodError when a private method is called" # Expected NoMethodError but no exception was raised ("module_private_method" was returned) fails "BasicObject#method_missing for a Module raises a NoMethodError when a protected method is called" # Expected NoMethodError but no exception was raised ("module_private_method" was returned) fails "BasicObject#method_missing for a Module with #method_missing defined is called when a private method is called" # Expected "module_private_method" == "module_method_missing" to be truthy but was false fails "BasicObject#method_missing for a Module with #method_missing defined is called when a protected method is called" # Expected "module_private_method" == "module_method_missing" to be truthy but was false fails "BasicObject#method_missing for an instance raises a NoMethodError when a private method is called" # Expected NoMethodError but no exception was raised ("instance_private_method" was returned) fails "BasicObject#method_missing for an instance raises a NoMethodError when a protected method is called" # Expected NoMethodError but no exception was raised ("instance_private_method" was returned) fails "BasicObject#method_missing for an instance with #method_missing defined is called when an private method is called" # Expected "instance_private_method" == "instance_method_missing" to be truthy but was false fails "BasicObject#method_missing for an instance with #method_missing defined is called when an protected method is called" # Expected "instance_private_method" == "instance_method_missing" to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/delegator.rb
spec/filters/unsupported/delegator.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Delegator" do fails "SimpleDelegator.new doesn't forward private method calls even via send or __send__" # Expected NoMethodError but no exception was raised (["priv", 42] was returned) fails "SimpleDelegator.new doesn't forward private method calls" # Expected NoMethodError but no exception was raised (["priv", nil] was returned) fails "SimpleDelegator.new forwards protected method calls" # Expected NoMethodError but no exception was raised ("protected" was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/privacy.rb
spec/filters/unsupported/privacy.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "privacy" do fails "A method definition always resets the visibility to public for nested definitions at the toplevel" # Expected NoMethodError (/private/) but no exception was raised ("nested_method_in_toplevel_method" was returned) fails "A method definition always resets the visibility to public for nested definitions in Class.new" # Expected NoMethodError (/private/) but no exception was raised ("new_def" was returned) fails "BasicObject#initialize is a private instance method" # Expected BasicObject to have private instance method 'initialize' but it does not fails "BasicObject#method_missing is a private method" # Expected BasicObject to have private instance method 'method_missing' but it does not fails "BasicObject#singleton_method_added is a private method" # Expected BasicObject to have private instance method 'singleton_method_added' but it does not fails "BasicObject#singleton_method_removed is a private method" # Expected BasicObject to have private instance method 'singleton_method_removed' but it does not fails "BasicObject#singleton_method_undefined is a private method" # Expected BasicObject to have private instance method 'singleton_method_undefined' but it does not fails "Defining a 'respond_to_missing?' method sets the method's visibility to private" # Expected DefRespondToMissingPSpec to have private instance method 'respond_to_missing?' but it does not fails "Defining a method at the top-level defines it on Object with private visibility by default" # Expected Object to have private instance method 'some_toplevel_method' but it does not fails "Defining an 'initialize' method sets the method's visibility to private" # Expected DefInitializeSpec to have private instance method 'initialize' but it does not fails "Defining an 'initialize_clone' method sets the method's visibility to private" # Expected DefInitializeCloneSpec to have private instance method 'initialize_clone' but it does not fails "Defining an 'initialize_copy' method sets the method's visibility to private" # Expected DefInitializeCopySpec to have private instance method 'initialize_copy' but it does not fails "Defining an 'initialize_dup' method sets the method's visibility to private" # Expected DefInitializeDupSpec to have private instance method 'initialize_dup' but it does not fails "DelegateClass.instance_method raises a NameError for a private instance methods of the delegated class" # Expected NameError but no exception was raised (#<UnboundMethod: DelegateSpecs::DelegateClass#priv (defined in #<Class:0x6cf4> in ./delegate.rb:360)> was returned) fails "DelegateClass.instance_methods does not include private methods" # Expected ["extra", "extra_private", "extra_protected", "__getobj__", "__setobj__", "pub", "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", "unpack_format", "DelegateClass", "expect", "eq", "pretty_print", "pretty_print_cycle", "pretty_print_instance_variables", "pretty_print_inspect", "<=>", "method", "Array", "at_exit", "caller", "caller_locations", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "define_singleton_method", "dup", "enum_for", "exit", "extend", "gets", "hash", "initialize_copy", "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", "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", "private_instance_methods", "protected_instance_methods", "eval", "binding", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "BigDecimal", "initialize", "method_missing", "respond_to_missing?", "target_respond_to?", "methods", "public_methods", "protected_methods", "==", "!=", "eql?", "!", "marshal_dump", "marshal_load", "initialize_clone", "initialize_dup", "freeze", "frozen?", "__raise__", "__send__", "__id__", "equal?", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined", "__marshal__", "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", "lang_send_rest_len", "example_instance_method_of_object", "defined_specs_method", "defined_specs_receiver", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "be_close_to_matrix", "check_autoload", "shellsplit", "shellwords", "shellescape", "shelljoin", "=~", "!~", "===", "inspect", "to_s", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel"] not to include "priv" fails "DelegateClass.private_instance_methods includes private instance methods of the DelegateClass class" # Expected [] to include "extra_private" fails "DelegateClass.protected_instance_methods includes protected instance methods of the DelegateClass class" # Expected [] to include "extra_protected" fails "DelegateClass.protected_instance_methods includes the protected methods of the delegated class" # Expected [] to include "prot" fails "DelegateClass.public_instance_methods does not include private methods" # Expected ["extra", "extra_private", "extra_protected", "__getobj__", "__setobj__", "pub", "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", "unpack_format", "DelegateClass", "expect", "eq", "pretty_print", "pretty_print_cycle", "pretty_print_instance_variables", "pretty_print_inspect", "<=>", "method", "Array", "at_exit", "caller", "caller_locations", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "define_singleton_method", "dup", "enum_for", "exit", "extend", "gets", "hash", "initialize_copy", "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", "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", "private_instance_methods", "protected_instance_methods", "eval", "binding", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "BigDecimal", "initialize", "method_missing", "respond_to_missing?", "target_respond_to?", "methods", "public_methods", "protected_methods", "==", "!=", "eql?", "!", "marshal_dump", "marshal_load", "initialize_clone", "initialize_dup", "freeze", "frozen?", "__raise__", "__send__", "__id__", "equal?", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined", "__marshal__", "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", "lang_send_rest_len", "example_instance_method_of_object", "defined_specs_method", "defined_specs_receiver", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "be_close_to_matrix", "check_autoload", "shellsplit", "shellwords", "shellescape", "shelljoin", "=~", "!~", "===", "inspect", "to_s", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel"] not to include "priv" fails "DelegateClass.public_instance_methods does not include the protected methods of the delegated class" # Expected ["extra", "extra_private", "extra_protected", "__getobj__", "__setobj__", "pub", "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", "unpack_format", "DelegateClass", "expect", "eq", "pretty_print", "pretty_print_cycle", "pretty_print_instance_variables", "pretty_print_inspect", "<=>", "method", "Array", "at_exit", "caller", "caller_locations", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "define_singleton_method", "dup", "enum_for", "exit", "extend", "gets", "hash", "initialize_copy", "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", "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", "private_instance_methods", "protected_instance_methods", "eval", "binding", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "BigDecimal", "initialize", "method_missing", "respond_to_missing?", "target_respond_to?", "methods", "public_methods", "protected_methods", "==", "!=", "eql?", "!", "marshal_dump", "marshal_load", "initialize_clone", "initialize_dup", "freeze", "frozen?", "__raise__", "__send__", "__id__", "equal?", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined", "__marshal__", "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", "lang_send_rest_len", "example_instance_method_of_object", "defined_specs_method", "defined_specs_receiver", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "be_close_to_matrix", "check_autoload", "shellsplit", "shellwords", "shellescape", "shelljoin", "=~", "!~", "===", "inspect", "to_s", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel"] not to include "prot" fails "Delegator#method raises a NameError for a private methods of the delegate object" # Expected warning to match: /delegator does not forward private method #priv/ but got: "" fails "Delegator#method raises a NameError for protected methods of the delegate object" # Expected warning to match: /delegator does not forward private method #prot/ but got: "" fails "Delegator#methods does not include private methods" # 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", "unpack_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", "lang_send_rest_len", "example_instance_method_of_object", "defined_specs_method", "defined_specs_receiver", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "be_close_to_matrix", "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__"] not to include "priv" fails "Delegator#private_methods includes all private instance methods of the Delegate class" # Expected [] to include "extra_private" fails "Delegator#protected_methods includes protected instance methods of the Delegator class" # Expected [] to include "extra_protected" fails "Delegator#protected_methods includes protected methods of the delegate object" # Expected [] to include "prot" fails "Enumerator#initialize is a private method" # Expected Enumerator to have private instance method 'initialize' but it does not fails "Enumerator::Chain#initialize is a private method" # Expected Enumerator::Chain to have private instance method 'initialize' but it does not fails "Enumerator::Generator#initialize is a private method" # Expected Enumerator::Generator to have private instance method 'initialize' but it does not fails "Enumerator::Lazy#initialize is a private method" # Expected Enumerator::Lazy to have private instance method 'initialize' but it does not fails "Enumerator::Yielder#initialize is a private method" # Expected Enumerator::Yielder to have private instance method 'initialize' but it does not fails "Kernel#Pathname is a private instance method" # Expected Kernel to have private instance method 'Pathname' but it does not fails "Kernel#block_given? is a private method" # Expected Kernel to have private instance method 'block_given?' but it does not fails "Kernel#eval is a private method" # Expected Kernel to have private instance method 'eval' but it does not fails "Kernel#initialize_clone is a private instance method" # Expected Kernel to have private instance method 'initialize_clone' but it does not fails "Kernel#initialize_dup is a private instance method" # Expected Kernel to have private instance method 'initialize_dup' but it does not fails "Kernel#local_variables is a private method" # Expected Kernel to have private instance method 'local_variables' but it does not fails "Kernel#p is a private method" # Expected Kernel to have private instance method 'p' but it does not fails "Kernel#print is a private method" # Expected Kernel to have private instance method 'print' but it does not fails "Kernel#printf is a private method" # Expected Kernel to have private instance method 'printf' but it does not fails "Kernel#private_methods returns a list of the names of privately accessible methods in the object and its ancestors and mixed-in modules" # Expected [] to include "shichi" fails "Kernel#private_methods returns a list of the names of privately accessible methods in the object" # Expected [] to include "shichi" fails "Kernel#private_methods returns private methods mixed in to the metaclass" # Expected [] to include "shoo" fails "Kernel#private_methods when not passed an argument returns a unique list for a class including a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#private_methods when not passed an argument returns a unique list for a subclass of a class that includes a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#private_methods when not passed an argument returns a unique list for an object extended by a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#private_methods when passed false returns a list of private methods in without its ancestors" # Expected [] == ["ds_pri", "fs_pri"] to be truthy but was false fails "Kernel#private_methods when passed nil returns a list of private methods in without its ancestors" # Expected [] == ["ds_pri", "fs_pri"] to be truthy but was false fails "Kernel#private_methods when passed true returns a unique list for a class including a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#private_methods when passed true returns a unique list for a subclass of a class that includes a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#private_methods when passed true returns a unique list for an object extended by a module" # Expected [] == ["pri"] to be truthy but was false fails "Kernel#protected_methods returns a list of the names of protected methods accessible in the object and from its ancestors and mixed-in modules" # Expected [] to include "juu_ichi" fails "Kernel#protected_methods returns a list of the names of protected methods accessible in the object" # Expected [] to include "juu_ichi" fails "Kernel#protected_methods returns methods mixed in to the metaclass" # Expected [] to include "nopeeking" fails "Kernel#protected_methods when not passed an argument returns a unique list for a class including a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#protected_methods when not passed an argument returns a unique list for a subclass of a class that includes a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#protected_methods when not passed an argument returns a unique list for an object extended by a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#protected_methods when passed false returns a list of protected methods in without its ancestors" # Expected [] == ["ds_pro", "fs_pro"] to be truthy but was false fails "Kernel#protected_methods when passed nil returns a list of protected methods in without its ancestors" # Expected [] == ["ds_pro", "fs_pro"] to be truthy but was false fails "Kernel#protected_methods when passed true returns a unique list for a class including a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#protected_methods when passed true returns a unique list for a subclass of a class that includes a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#protected_methods when passed true returns a unique list for an object extended by a module" # Expected [] == ["pro"] to be truthy but was false fails "Kernel#public_send called from own public method raises a NoMethodError if the method is private" # Expected NoMethodError but got: RuntimeError (Should not called) fails "Kernel#public_send called from own public method raises a NoMethodError if the method is protected" # Expected NoMethodError but got: RuntimeError (Should not called) fails "Kernel#public_send raises a NoMethodError if the method is protected" # Expected NoMethodError but no exception was raised ("done" was returned) fails "Kernel#public_send raises a NoMethodError if the named method is an alias of a private method" # Expected NoMethodError but no exception was raised ("done2" was returned) fails "Kernel#public_send raises a NoMethodError if the named method is an alias of a protected method" # Expected NoMethodError but no exception was raised ("done2" was returned) fails "Kernel#public_send raises a NoMethodError if the named method is private" # Expected NoMethodError but no exception was raised ("done2" was returned) fails "Kernel#puts is a private method" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x2d0e6 @name=nil @stdout=#<IO:0xa @fd=1 @flags="w" @eof=false @closed="read" @write_proc=#<Proc:0x2d0ec> @tty=true>> fails "Kernel#respond_to? does not change method visibility when finding private method" # Expected true == false to be truthy but was false fails "Kernel#respond_to? returns false even if obj responds to the given private method (include_private = false)" # Expected true == false to be truthy but was false fails "Kernel#respond_to? returns false if obj responds to the given private method" # Expected true == false to be truthy but was false fails "Kernel#respond_to? returns false if obj responds to the given protected method (include_private = false)" # Expected true == false to be truthy but was false fails "Kernel#respond_to? returns false if obj responds to the given protected method" # Expected true == false to be truthy but was false fails "Kernel#respond_to_missing? is a private method" # Expected Kernel to have private instance method 'respond_to_missing?' but it does not fails "Kernel#respond_to_missing? is called when obj responds to the given private method, include_private = false" # Mock '#<KernelSpecs::A:0x37840>' expected to receive respond_to_missing?("private_method", false) exactly 1 times but received it 0 times fails "Kernel#respond_to_missing? is called when obj responds to the given protected method, include_private = false" # Expected true to be false fails "Kernel#singleton_methods when not passed an argument does not return private class methods for a class" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::A fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a class including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::D fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a module including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::N fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a subclass including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::C fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a subclass of a class including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::E fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a subclass of a class that includes a module, where the subclass also includes a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::F fails "Kernel#singleton_methods when not passed an argument does not return private inherited singleton methods for a subclass" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::B fails "Kernel#singleton_methods when not passed an argument does not return private module methods for a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::M fails "Kernel#singleton_methods when not passed an argument does not return private singleton methods for a class extended with a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::P fails "Kernel#singleton_methods when not passed an argument does not return private singleton methods for an object extended with a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x446a @name="Object extended" @null=nil> fails "Kernel#singleton_methods when not passed an argument does not return private singleton methods for an object extended with two modules" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x447a @name="Object extended twice" @null=nil> fails "Kernel#singleton_methods when passed false does not return private class methods for a class" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::A fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a class including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::D fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a module including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::N fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a subclass including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::C fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a subclass of a class including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::E fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a subclass of a class that includes a module, where the subclass also includes a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::F fails "Kernel#singleton_methods when passed false does not return private inherited singleton methods for a subclass" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::B fails "Kernel#singleton_methods when passed false does not return private module methods for a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::M fails "Kernel#singleton_methods when passed false does not return private singleton methods for a class extended with a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::P fails "Kernel#singleton_methods when passed false does not return private singleton methods for an object extended with a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x44bc @name="Object extended" @null=nil> fails "Kernel#singleton_methods when passed false does not return private singleton methods for an object extended with two modules" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x44b8 @name="Object extended twice" @null=nil> fails "Kernel#singleton_methods when passed true does not return private class methods for a class" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::A fails "Kernel#singleton_methods when passed true does not return private inherited singleton methods for a class including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::D fails "Kernel#singleton_methods when passed true does not return private inherited singleton methods for a module including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::N fails "Kernel#singleton_methods when passed true does not return private inherited singleton methods for a subclass including a module" # NoMethodError: undefined method `singleton_methods' for ReflectSpecs::C
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
true
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/math.rb
spec/filters/unsupported/math.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Math" do fails "Math#atanh is a private instance method" # Expected Math to have private instance method 'atanh' but it does not end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/array.rb
spec/filters/unsupported/array.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Array" do fails "Array#[] raises a RangeError when the length is out of range of Fixnum" # Expected RangeError but no exception was raised ([2, 3, 4, 5, 6] was returned) fails "Array#[] raises a RangeError when the start index is out of range of Fixnum" # Expected RangeError but no exception was raised (nil was returned) fails "Array#eql? returns false if any corresponding elements are not #eql?" # Expected [1, 2, 3, 4] not to have same value or type as [1, 2, 3, 4] fails "Array#fill does not replicate the filler" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "Array#first raises a RangeError when count is a Bignum" # Expected RangeError but no exception was raised ([] was returned) fails "Array#hash calls to_int on result of calling hash on each element" # Expected "A,#<MockObject:0x876aa>" == "A,3" to be truthy but was false fails "Array#hash returns the same fixnum for arrays with the same content" # Expected "A" (String) to be an instance of Integer fails "Array#initialize is private" # Expected Array to have private instance method 'initialize' but it does not fails "Array#inspect represents a recursive element with '[...]'" # Expected "[1, \"two\", 3, [...], [...], [...], [...], [...]]" == "[1, \"two\", 3.0, [...], [...], [...], [...], [...]]" to be truthy but was false fails "Array#inspect with encoding does not raise if inspected result is not default external encoding" # Mock 'utf_16be' expected to receive inspect("any_args") exactly 1 times but received it 0 times fails "Array#inspect with encoding returns a US-ASCII string for an empty Array" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Array#inspect with encoding use US-ASCII encoding if the default external encoding is not ascii compatible" # ArgumentError: unknown encoding name - UTF-32 fails "Array#inspect with encoding use the default external encoding if it is ascii compatible" # ArgumentError: unknown encoding name - EUC-JP fails "Array#join fails for arrays with incompatibly-encoded strings" # Expected EncodingError but no exception was raised ("barbázÿ" was returned) fails "Array#join returns a US-ASCII string for an empty Array" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Array#join uses the first encoding when other strings are compatible" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Array#slice raises a RangeError when the length is out of range of Fixnum" # Expected RangeError but no exception was raised ([2, 3, 4, 5, 6] was returned) fails "Array#slice raises a RangeError when the start index is out of range of Fixnum" # Expected RangeError but no exception was raised (nil was returned) fails "Array#to_s represents a recursive element with '[...]'" # Expected "[1, \"two\", 3, [...], [...], [...], [...], [...]]" == "[1, \"two\", 3.0, [...], [...], [...], [...], [...]]" to be truthy but was false fails "Array#to_s with encoding does not raise if inspected result is not default external encoding" # Mock 'utf_16be' expected to receive inspect("any_args") exactly 1 times but received it 0 times fails "Array#to_s with encoding returns a US-ASCII string for an empty Array" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Array#to_s with encoding use US-ASCII encoding if the default external encoding is not ascii compatible" # ArgumentError: unknown encoding name - UTF-32 fails "Array#to_s with encoding use the default external encoding if it is ascii compatible" # ArgumentError: unknown encoding name - EUC-JP fails "Array#uniq uses eql? semantics" # Expected [1] == [1, 1] to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/set.rb
spec/filters/unsupported/set.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Set" do fails "Set#eql? returns true when the passed argument is a Set and contains the same elements" # Expected #<Set: {1,2,3}> not to have same value or type as #<Set: {1,2,3}> fails "Set#initialize is private" # Expected Set to have private instance method 'initialize' but it does not end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/time.rb
spec/filters/unsupported/time.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Time" do fails "Time#+ accepts arguments that can be coerced into Rational" # Mock '10' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time#+ adds a negative Float" # Expected 700000 == 699999 to be truthy but was false fails "Time#+ increments the time by the specified amount as rational numbers" # Expected 1970-01-01 01:00:01 +0100 == 1970-01-01 01:00:02 +0100 to be truthy but was false fails "Time#+ maintains microseconds precision" # Expected 0 == 999999 to be truthy but was false fails "Time#+ maintains nanoseconds precision" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:08 +0100 fails "Time#+ maintains subseconds precision" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:08 +0100 fails "Time#+ returns a time with the same fixed offset as self" # Expected 60 == 3600 to be truthy but was false fails "Time#+ tracks microseconds" # Expected 0 == 123456 to be truthy but was false fails "Time#+ tracks nanoseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100 fails "Time#- accepts arguments that can be coerced into Rational" # Mock '10' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time#- maintains microseconds precision" # Expected 0 == 999999 to be truthy but was false fails "Time#- maintains nanoseconds precision" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:10 +0100 fails "Time#- maintains precision" # Expected 1970-01-01 01:00:09 +0100 == 1970-01-01 01:00:09 +0100 to be falsy but was true fails "Time#- maintains subseconds precision" # NoMethodError: undefined method `subsec' for 1970-01-01 00:59:59 +0100 fails "Time#- returns a time with nanoseconds precision between two time objects" # Expected 86399 == 86399.999999998 to be truthy but was false fails "Time#- returns a time with the same fixed offset as self" # Expected 60 == 3600 to be truthy but was false fails "Time#- tracks microseconds" # Expected 122000 == 123456 to be truthy but was false fails "Time#- tracks nanoseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100 fails "Time#<=> returns -1 if the first argument is a fraction of a microsecond before the second argument" # Expected 0 == -1 to be truthy but was false fails "Time#<=> returns -1 if the first argument is a point in time before the second argument (down to a microsecond)" # Expected 0 == -1 to be truthy but was false fails "Time#<=> returns 1 if the first argument is a fraction of a microsecond after the second argument" # Expected 0 == 1 to be truthy but was false fails "Time#<=> returns 1 if the first argument is a point in time after the second argument (down to a microsecond)" # Expected 0 == 1 to be truthy but was false fails "Time#dup returns a subclass instance" # Expected 2022-12-07 04:50:25 +0100 (Time) to be an instance of #<Class:0x3828> fails "Time#eql? returns false if self and other have differing fractional microseconds" # Expected 1970-01-01 01:01:40 +0100 not to have same value or type as 1970-01-01 01:01:40 +0100 fails "Time#eql? returns false if self and other have differing numbers of microseconds" # Expected 1970-01-01 01:01:40 +0100 not to have same value or type as 1970-01-01 01:01:40 +0100 fails "Time#getgm returns a new time which is the utc representation of time" # Expected 2007-01-09 05:00:00 UTC == 2007-01-09 12:00:00 UTC to be truthy but was false fails "Time#getlocal raises ArgumentError if the String argument is not of the form (+|-)HH:MM" # Expected ArgumentError but got: NoMethodError (undefined method `getlocal' for 2022-12-07 04:50:51 +0100) fails "Time#getlocal raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # NoMethodError: undefined method `getlocal' for 2022-12-07 04:50:51 +0100 fails "Time#getlocal raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # NoMethodError: undefined method `getlocal' for 2022-12-07 04:50:51 +0100 fails "Time#getlocal returns a Time with UTC offset specified as an Integer number of seconds" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC fails "Time#getlocal returns a Time with a UTC offset of the specified number of Rational seconds" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC fails "Time#getlocal returns a Time with a UTC offset specified as +HH:MM" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC fails "Time#getlocal returns a Time with a UTC offset specified as -HH:MM" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC fails "Time#getlocal returns a new time which is the local representation of time" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#getlocal returns a new time with the correct utc_offset according to the set timezone" # Expected -60 == -3600 to be truthy but was false fails "Time#getlocal with an argument that responds to #to_int coerces using #to_int" # Mock 'integer' expected to receive to_int("any_args") exactly 1 times but received it 0 times fails "Time#getlocal with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time#getlocal with an argument that responds to #to_str coerces using #to_str" # Mock 'string' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Time#getutc returns a new time which is the utc representation of time" # Expected 2007-01-09 05:00:00 UTC == 2007-01-09 12:00:00 UTC to be truthy but was false fails "Time#gmt_offset given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false fails "Time#gmt_offset given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false fails "Time#gmt_offset returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false fails "Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false fails "Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false fails "Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false fails "Time#gmt_offset returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false fails "Time#gmtoff given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false fails "Time#gmtoff given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false fails "Time#gmtoff returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false fails "Time#gmtoff returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false fails "Time#gmtoff returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false fails "Time#gmtoff returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false fails "Time#gmtoff returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false fails "Time#localtime changes the timezone according to the set one" # Expected -60 == -3600 to be truthy but was false fails "Time#localtime converts self to local time, modifying the receiver" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime converts time to the UTC offset specified as an Integer number of seconds" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime does nothing if already in a local time zone" # NoMethodError: undefined method `localtime' for 2005-02-27 22:50:00 +0100 fails "Time#localtime raises ArgumentError if the String argument is not of the form (+|-)HH:MM" # Expected ArgumentError but got: NoMethodError (undefined method `localtime' for 2022-12-07 04:50:47 +0100) fails "Time#localtime raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # NoMethodError: undefined method `localtime' for 2022-12-07 04:50:47 +0100 fails "Time#localtime raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # NoMethodError: undefined method `localtime' for 2022-12-07 04:50:47 +0100 fails "Time#localtime returns a Time with a UTC offset of the specified number of Rational seconds" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime returns a Time with a UTC offset specified as +HH:MM" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime returns a Time with a UTC offset specified as -HH:MM" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime returns self" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC fails "Time#localtime with an argument that responds to #to_int coerces using #to_int" # Mock 'integer' expected to receive to_int("any_args") exactly 1 times but received it 0 times fails "Time#localtime with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time#localtime with an argument that responds to #to_str coerces using #to_str" # Mock 'string' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "Time#nsec returns 0 for a Time constructed with a whole number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:01:40 +0100 fails "Time#nsec returns the nanoseconds part of a Time constructed with a Float number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:10 +0100 fails "Time#nsec returns the nanoseconds part of a Time constructed with a Rational number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:01 +0100 fails "Time#nsec returns the nanoseconds part of a Time constructed with an Float number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100 fails "Time#nsec returns the nanoseconds part of a Time constructed with an Integer number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100 fails "Time#nsec returns the nanoseconds part of a Time constructed with an Rational number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100 fails "Time#strftime with %L formats the milliseconds of the second" # Expected "000" == "100" to be truthy but was false fails "Time#strftime with %z formats a UTC time offset as '+0000'" # Expected "+0100" == "+0000" to be truthy but was false fails "Time#strftime with %z formats a local time with negative UTC offset as '-HHMM'" # Expected "+0100" == "-0800" to be truthy but was false fails "Time#strftime with %z formats a time with fixed offset as '+/-HH:MM:SS' with '::' specifier" # Expected "+01:01.0833333333333286" == "+01:01:05" to be truthy but was false fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Float number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:10 +0100 fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Rational number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:01 +0100 fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Float number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100 fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Integer number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100 fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Rational number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100 fails "Time#to_a returns a 10 element array representing the deconstructed time" # Expected [0, 0, 1, 1, 1, 1970, 4, 1, false, "Central European Standard Time"] == [0, 0, 18, 31, 12, 1969, 3, 365, false, "CST"] to be truthy but was false fails "Time#to_r returns a Rational even for a whole number of seconds" # NoMethodError: undefined method `to_r' for 1970-01-01 01:00:02 +0100 fails "Time#to_r returns the a Rational representing seconds and subseconds since the epoch" # NoMethodError: undefined method `to_r' for 1970-01-01 01:00:01 +0100 fails "Time#usec returns the microseconds for time created by Time#local" # Expected 0 == 780000 to be truthy but was false fails "Time#usec returns the microseconds part of a Time constructed with a Rational number of seconds" # Expected 0 == 500000 to be truthy but was false fails "Time#usec returns the microseconds part of a Time constructed with an Float number of microseconds > 1" # Expected 0 == 3 to be truthy but was false fails "Time#usec returns the microseconds part of a Time constructed with an Integer number of microseconds" # Expected 999000 == 999999 to be truthy but was false fails "Time#usec returns the microseconds part of a Time constructed with an Rational number of microseconds > 1" # Expected 0 == 9 to be truthy but was false fails "Time#utc_offset given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false fails "Time#utc_offset given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false fails "Time#utc_offset returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false fails "Time#utc_offset returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false fails "Time#utc_offset returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false fails "Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false fails "Time#utc_offset returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false fails "Time#zone Encoding.default_internal is set doesn't raise errors for a Time with a fixed offset" # NoMethodError: undefined method `default_internal' for Encoding fails "Time#zone returns nil when getting the local time with a fixed offset" # NoMethodError: undefined method `getlocal' for 2005-02-27 22:50:00 -0100 fails "Time#zone returns the correct timezone for a local time" # NoMethodError: undefined method `getlocal' for 2005-02-27 22:50:00 -0100 fails "Time#zone returns the time zone used for time" # Expected "Central European Standard Time" == "EST" to be truthy but was false fails "Time.at passed Numeric returns a subclass instance on a Time subclass" # Expected 1970-01-01 01:00:00 +0100 (Time) to be an instance of #<Class:0x29828> fails "Time.at passed Time returns a subclass instance" # Expected 2022-12-07 04:50:36 +0100 (Time) to be an instance of #<Class:0x29836> fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Float microseconds since 1970-01-01 00:00:00 UTC" # NoMethodError: undefined method `tv_nsec' for 1970-01-01 01:00:10 +0100 fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time.at with a second argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times fails "Time.gm handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false fails "Time.gm handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false fails "Time.gm handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false fails "Time.gm handles microseconds" # Expected 0 == 123 to be truthy but was false fails "Time.gm ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false fails "Time.gm ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false fails "Time.gm returns subclass instances" # Expected 2008-12-01 00:00:00 UTC (Time) to be an instance of #<Class:0x864ca> fails "Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false fails "Time.local creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false fails "Time.local creates the correct time just after dst change" # Expected 7200 == -18000 to be truthy but was false fails "Time.local creates the correct time just before dst change" # Expected 7200 == -14400 to be truthy but was false fails "Time.local handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false fails "Time.local handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false fails "Time.local handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false fails "Time.local handles microseconds" # Expected 0 == 123 to be truthy but was false fails "Time.local ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false fails "Time.local ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false fails "Time.local returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x1c7d0> fails "Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false fails "Time.mktime creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false fails "Time.mktime creates the correct time just after dst change" # Expected 7200 == -18000 to be truthy but was false fails "Time.mktime creates the correct time just before dst change" # Expected 7200 == -14400 to be truthy but was false fails "Time.mktime handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false fails "Time.mktime handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false fails "Time.mktime handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false fails "Time.mktime handles microseconds" # Expected 0 == 123 to be truthy but was false fails "Time.mktime ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false fails "Time.mktime ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false fails "Time.mktime returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x5e2b2> fails "Time.new creates a subclass instance if called on a subclass" # Expected 2022-12-07 04:51:02 +0100 (Time) to be an instance of TimeSpecs::SubTime fails "Time.new creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false fails "Time.new handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false fails "Time.new returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x8e0da> fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # Expected 1439.9833333333333 == 86399 to be truthy but was false fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # Expected -1439.9833333333333 == -86399 to be truthy but was false fails "Time.new with a utc_offset argument raises ArgumentError if the hour value is greater than 23" # Expected ArgumentError but no exception was raised (2000-01-01 00:00:00 +2400 was returned) fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Integer seconds" # Expected 2.05 == 123 to be truthy but was false fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Rational seconds" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as +HH:MM" # Expected 330 == 19800 to be truthy but was false fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as -HH:MM" # ArgumentError: "+HH:MM", "-HH:MM", "UTC" expected for utc_offset: -04:10:43 fails "Time.new with a utc_offset argument returns a local Time if the argument is nil" # Expected 3600 == -28800 to be truthy but was false fails "Time.new with a utc_offset argument returns a non-UTC time" # Expected 2000-01-01 00:00:00 UTC.utc? to be falsy but was true fails "Time.new with a utc_offset argument with an argument that responds to #to_int coerces using #to_int" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "Time.new with a utc_offset argument with an argument that responds to #to_r coerces using #to_r" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "Time.new with a utc_offset argument with an argument that responds to #to_str coerces using #to_str" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String fails "Time.now creates a subclass instance if called on a subclass" # Expected 2022-12-07 04:50:35 +0100 (Time) to be an instance of TimeSpecs::SubTime fails "Time.utc handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false fails "Time.utc handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false fails "Time.utc handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false fails "Time.utc handles microseconds" # Expected 0 == 123 to be truthy but was false fails "Time.utc ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false fails "Time.utc ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false fails "Time.utc returns subclass instances" # Expected 2008-12-01 00:00:00 UTC (Time) to be an instance of #<Class:0x88f30> fails_badly "Marshal.load for a Time loads the zone" # Seasonal failure fails_badly "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Seasonal failure fails_badly "Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Seasonal failure end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/file.rb
spec/filters/unsupported/file.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "File" do fails "File.join doesn't mutate the object when calling #to_str" # Mock 'usr' expected to receive to_str("any_args") exactly 1 times but received it 0 times end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/float.rb
spec/filters/unsupported/float.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Float" do fails "Complex#/ with Fixnum raises a ZeroDivisionError when given zero" # Expected ZeroDivisionError but no exception was raised ((Infinity+Infinity*i) was returned) fails "Complex#eql? returns false when the imaginary parts are of different classes" # Expected true to be false fails "Complex#eql? returns false when the real parts are of different classes" # Expected true to be false fails "Complex#quo with Fixnum raises a ZeroDivisionError when given zero" # Expected ZeroDivisionError but no exception was raised ((Infinity+Infinity*i) was returned) fails "Complex#rationalize raises RangeError if self has 0.0 imaginary part" # Expected RangeError but no exception was raised ((1/1) was returned) fails "Complex#to_f when the imaginary part is Float 0.0 raises RangeError" # Expected RangeError but no exception was raised (0 was returned) fails "Complex#to_i when the imaginary part is Float 0.0 raises RangeError" # Expected RangeError but no exception was raised (0 was returned) fails "Complex#to_r when the imaginary part is Float 0.0 raises RangeError" # Expected RangeError but no exception was raised ((0/1) was returned) fails "Complex#to_s returns 1+0.0i for Complex(1, 0.0)" # Expected "1+0i" == "1+0.0i" to be truthy but was false fails "Complex#to_s returns 1-0.0i for Complex(1, -0.0)" # Expected "1+0i" == "1-0.0i" to be truthy but was false fails "Float constant MAX_10_EXP is 308" # NameError: uninitialized constant Float::MAX_10_EXP fails "Float constant MAX_EXP is 1024" # NameError: uninitialized constant Float::MAX_EXP fails "Float constant MIN_10_EXP is -308" # NameError: uninitialized constant Float::MIN_10_EXP fails "Float constant MIN_EXP is -1021" # NameError: uninitialized constant Float::MIN_EXP fails "Float#<=> returns -1 when self is -Infinity and other is negative" # Expected 0 == -1 to be truthy but was false fails "Float#<=> returns 1 when self is Infinity and other is an Integer" # Expected 0 == 1 to be truthy but was false fails "Float#<=> returns 1 when self is negative and other is -Infinity" # Expected 0 == 1 to be truthy but was false fails "Float#eql? returns false if other is not a Float" # Expected true to be false fails "Float#to_s emits a trailing '.0' for a whole number" # Expected "50" == "50.0" to be truthy but was false fails "Float#to_s emits a trailing '.0' for the mantissa in e format" # Expected "100000000000000000000" == "1.0e+20" to be truthy but was false fails "Float#to_s returns '0.0' for 0.0" # Expected "0" == "0.0" to be truthy but was false fails "Math.gamma returns approximately (n-1)! given n for n between 24 and 30" # Expected 1.5511210043330984e+25 to be within 1.5511210043330986e+25 +/- 330986 fails "Rational#% returns a Float value when the argument is Float" # Expected (3/4) (Rational) to be kind of Float fails "Rational#** raises ZeroDivisionError for Rational(0, 1) passed a negative Integer" # Expected ZeroDivisionError (divided by 0) but no exception was raised (Infinity was returned) fails "Rational#/ when passed an Integer raises a ZeroDivisionError when passed 0" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Rational#coerce returns the passed argument, self as Float, when given a Float" # Expected false to be true fails "Rational#divmod when passed an Integer returns the quotient as Integer and the remainder as Rational" # Expected [1537228672809129200, (0/1)] to have same value and type as [1537228672809129200, (1/1)] fails "Struct#eql? returns false if any corresponding elements are not #eql?" # Expected #<struct StructClasses::Car make="Honda", model="Accord", year=1998> not to have same value or type as #<struct StructClasses::Car make="Honda", model="Accord", year=1998> end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/kernel.rb
spec/filters/unsupported/kernel.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Kernel" do fails "Kernel has private instance method Array()" # Expected Kernel to have private instance method 'Array' but it does not fails "Kernel has private instance method Hash()" # Expected Kernel to have private instance method 'Hash' but it does not fails "Kernel#Float is a private method" # Expected Kernel to have private instance method 'Float' but it does not fails "Kernel#Float raises a TypeError if #to_f returns an Integer" # Expected TypeError but no exception was raised (123 was returned) fails "Kernel#Integer is a private method" # Expected Kernel to have private instance method 'Integer' but it does not fails "Kernel#String is a private method" # Expected Kernel to have private instance method 'String' but it does not fails "Kernel#class returns the first non-singleton class" # TypeError: can't define singleton fails "Kernel#eql? is a public instance method" # Expected Kernel to have public instance method 'eql?' but it does not fails "Kernel#fail is a private method" # Expected Kernel to have private instance method 'fail' but it does not fails "Kernel#format is a private method" # Expected Kernel to have private instance method 'format' but it does not fails "Kernel#initialize_dup returns the receiver" # Expected nil == #<Object:0x6a424> to be truthy but was false fails "Kernel#raise is a private method" # Expected Kernel to have private instance method 'raise' but it does not fails "Kernel#sleep accepts a Rational" # TypeError: can't convert Rational into time interval fails "Kernel#sleep is a private method" # Expected Kernel to have private instance method 'sleep' but it does not fails "Kernel#sleep pauses execution indefinitely if not given a duration" # NotImplementedError: Thread creation not available fails "Kernel#warn calls Warning.warn with category: nil if Warning.warn accepts keyword arguments" # NameError: uninitialized constant Warning fails "Kernel#warn calls Warning.warn with given category keyword converted to a symbol" # NameError: uninitialized constant Warning fails "Kernel#warn calls Warning.warn without keyword arguments if Warning.warn does not accept keyword arguments" # NameError: uninitialized constant Warning fails "Kernel#warn is a private method" # Expected Kernel to have private instance method 'warn' but it does not fails "Kernel.Float raises a TypeError if #to_f returns an Integer" # Expected TypeError but no exception was raised (123 was returned) fails "Kernel.lambda when called without a literal block warns when proc isn't a lambda" # Expected warning: "ruby/core/kernel/lambda_spec.rb:142: warning: lambda without a literal block is deprecated; use the proc without lambda instead\n" but got: "" end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/bignum.rb
spec/filters/unsupported/bignum.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Bignum" do fails "BasicObject#__id__ returns a different value for two Bignum literals" # Expected 4e+100 == 4e+100 to be falsy but was true fails "Complex#== with Numeric returns true when self's imaginary part is 0 and the real part and other have numerical equality" # Expected (18446744073709552000+0i) == 18446744073709552000 to be falsy but was true fails "Complex#fdiv with an imaginary part sets the real part to self's real part fdiv'd with the argument" # Expected (9223372036854776000/5) == 1844674407370955300 to be truthy but was false fails "Complex#fdiv with no imaginary part sets the real part to self's real part fdiv'd with the argument" # Expected (9223372036854776000/5) == 1844674407370955300 to be truthy but was false fails "Enumerable#first raises a RangeError when passed a Bignum" # Expected RangeError but no exception was raised ([] was returned) fails "Float#round returns rounded values for big values" # Expected 0 to have same value and type as 200000000000000000000 fails "Integer#gcd accepts a Bignum argument" # Expected Infinity (Number) to be kind of Integer fails "Integer#gcd works if self is a Bignum" # Expected Infinity (Number) to be kind of Integer fails "Integer#gcdlcm accepts a Bignum argument" # Expected Infinity (Number) to be kind of Integer fails "Integer#gcdlcm works if self is a Bignum" # Expected Infinity (Number) to be kind of Integer fails "Integer#lcm accepts a Bignum argument" # Expected Infinity (Number) to be kind of Integer fails "Integer#lcm works if self is a Bignum" # Expected Infinity (Number) to be kind of Integer fails "Integer#rationalize returns a Rational object" # FloatDomainError: Infinity fails "Integer#rationalize uses 1 as the denominator" # FloatDomainError: Infinity fails "Integer#rationalize uses self as the numerator" # FloatDomainError: Infinity fails "Integer#round returns itself rounded if passed a negative value" # Expected 0 to have same value and type as 1.9999999999999998e+71 fails "Integer#to_r works even if self is a Bignum" # Expected Infinity (Number) to be an instance of Integer fails "Marshal.dump with a Bignum dumps a Bignum" # Expected "\x04\bl-\tÿÿÿÿÿÿÿ?" to be computed by Marshal.dump from -4611686018427388000 (computed "\x04\bl-\t\x00\x00\x00\x00\x00\x00\x00@" instead) fails "Numeric#numerator converts self to a Rational object then returns its numerator" # Exception: Maximum call stack size exceeded fails "Numeric#quo raises a ZeroDivisionError when the given Integer is 0" # Expected ZeroDivisionError but no exception was raised (NaN was returned) fails "Rational#** when passed Bignum raises ZeroDivisionError when self is Rational(0) and the exponent is negative" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Rational#** when passed Bignum returns 0.0 when self is < -1 and the exponent is negative" # Exception: Maximum call stack size exceeded fails "Rational#** when passed Bignum returns 0.0 when self is > 1 and the exponent is negative" # Exception: Maximum call stack size exceeded fails "Rational#** when passed Bignum returns Rational(-1) when self is Rational(-1) and the exponent is positive and odd" # Expected (1/1) to have same value and type as (-1/1) fails "Rational#** when passed Bignum returns positive Infinity when self < -1" # Exception: Maximum call stack size exceeded fails "Rational#** when passed Bignum returns positive Infinity when self is > 1" # Exception: Maximum call stack size exceeded fails "Rational#round with a precision > 0 doesn't fail when rounding to an absurdly large positive precision" # FloatDomainError: Infinity end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/usage_of_files.rb
spec/filters/unsupported/usage_of_files.rb
# NOTE: run bin/format-filters after changing this file opal_filter "Specs that use temporary files" do fails "A Symbol literal inherits the encoding of the magic comment and can have a binary encoding" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x94928> fails "Kernel.printf formatting io is not specified flags # applies to format o does nothing for negative argument" # Expected "0..7651" == "..7651" to be truthy but was false fails "Kernel.printf formatting io is not specified flags # applies to formats aAeEfgG changes format from dd.dddd to exponential form for gG" # Expected "1.234e+02" == "1.e+02" to be truthy but was false fails "Kernel.printf formatting io is not specified flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified flags (digit)$ specifies the absolute argument number for this field" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified flags * left-justifies the result if specified with $ argument is negative" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "Kernel.printf formatting io is not specified flags * left-justifies the result if width is negative" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "Kernel.printf formatting io is not specified flags * raises ArgumentError when is mixed with width" # Expected ArgumentError but no exception was raised (" 112" was returned) fails "Kernel.printf formatting io is not specified flags * uses the previous argument as the field width" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "Kernel.printf formatting io is not specified flags * uses the specified argument as the width if * is followed by a number and $" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "Kernel.printf formatting io is not specified flags + applies to numeric formats bBdiouxXaAeEfgG adds a leading plus sign to non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified flags - left-justifies the result of conversion if width is specified" # Expected "1.095200e+2 " == "1.095200e+02 " to be truthy but was false fails "Kernel.printf formatting io is not specified flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified pads with zeros, not spaces" # Expected "0000000001.095200e+02" == "000000001.095200e+02" to be truthy but was false fails "Kernel.printf formatting io is not specified flags space applies to numeric formats bBdiouxXeEfgGaA does not leave a space at the start of negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified flags space applies to numeric formats bBdiouxXeEfgGaA leaves a space at the start of non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified flags space applies to numeric formats bBdiouxXeEfgGaA treats several white spaces as one" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats A converts floating point argument as [-]0xh.hhhhp[+-]dd and use uppercase X and P" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats A displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats A displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats G otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" == "12.1234" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats G otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" == "1.12346" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats G otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" == "1.55556" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats G the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567E+06" == "1.23457E+06" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats a converts floating point argument as [-]0xh.hhhhp[+-]dd" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats a displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats a displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified float formats g otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" == "12.1234" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats g otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" == "1.12346" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats g otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" == "1.55556" to be truthy but was false fails "Kernel.printf formatting io is not specified float formats g the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567e+06" == "1.23457e+06" to be truthy but was false fails "Kernel.printf formatting io is not specified integer formats d works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "Kernel.printf formatting io is not specified integer formats i works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "Kernel.printf formatting io is not specified integer formats u works well with large numbers" # Expected "1234567890987654400" == "1234567890987654321" to be truthy but was false fails "Kernel.printf formatting io is not specified other formats % alone raises an ArgumentError" # Expected ArgumentError but no exception was raised ("%" was returned) fails "Kernel.printf formatting io is not specified precision float types controls the number of decimal places displayed in fraction part" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet fails "Kernel.printf formatting io is not specified precision float types does not affect G format" # Expected "12.12340000" == "12.1234" to be truthy but was false fails "Kernel.printf formatting io is not specified precision string formats determines the maximum number of characters to be copied from the string" # Expected "1" == "[" to be truthy but was false fails "Kernel.printf formatting io is not specified width specifies the minimum number of characters that will be written to the result" # Expected " 1.095200e+02" == " 1.095200e+02" to be truthy but was false fails "Kernel.printf formatting io is specified faulty key raises a KeyError" # Expected KeyError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified faulty key sets the Hash as the receiver of KeyError" # Expected KeyError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified faulty key sets the unmatched key as the key of KeyError" # Expected KeyError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified flags # applies to format o does nothing for negative argument" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to format o increases the precision until the first digit will be `0' if it is not formatted as complements" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to formats aAeEfgG changes format from dd.dddd to exponential form for gG" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to formats bBxX does nothing for zero argument" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to formats bBxX prefixes the result with 0x, 0X, 0b and 0B respectively for non-zero argument" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags # applies to gG does not remove trailing zeros" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags (digit)$ ignores '-' sign" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags (digit)$ raises ArgumentError exception when absolute and relative argument numbers are mixed" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified flags (digit)$ raises exception if argument number is bigger than actual arguments list" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified flags (digit)$ specifies the absolute argument number for this field" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags * left-justifies the result if specified with $ argument is negative" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags * left-justifies the result if width is negative" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags * raises ArgumentError when is mixed with width" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified flags * uses the previous argument as the field width" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags * uses the specified argument as the width if * is followed by a number and $" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags + applies to numeric formats bBdiouxXaAeEfgG adds a leading plus sign to non-negative numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags + applies to numeric formats bBdiouxXaAeEfgG does not use two's complement form for negative numbers for formats bBoxX" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags - left-justifies the result of conversion if width is specified" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified pads with zeros, not spaces" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified uses radix-1 when displays negative argument as a two's complement" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags space applies to numeric formats bBdiouxXeEfgGaA does not leave a space at the start of negative numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags space applies to numeric formats bBdiouxXeEfgGaA leaves a space at the start of non-negative numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags space applies to numeric formats bBdiouxXeEfgGaA prevents converting negative argument to two's complement form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified flags space applies to numeric formats bBdiouxXeEfgGaA treats several white spaces as one" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats A converts floating point argument as [-]0xh.hhhhp[+-]dd and use uppercase X and P" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats A displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats A displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats E converts argument into exponential notation [-]d.dddddde[+-]dd" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats E cuts excessive digits and keeps only 6 ones" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats E displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats E displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats E rounds the last significant digit to the closest one" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G otherwise converts a floating point number in dd.dddd form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G otherwise cuts fraction part to have only 6 digits at all" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G otherwise rounds the last significant digit to the closest one in fractional part" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats G the exponent is less than -4 converts a floating point number using exponential form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats a converts floating point argument as [-]0xh.hhhhp[+-]dd" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats a displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats a displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats converts argument into Float" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats e converts argument into exponential notation [-]d.dddddde[+-]dd" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats e cuts excessive digits and keeps only 6 ones" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats e displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats e displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats e rounds the last significant digit to the closest one" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats f converts floating point argument as [-]ddd.dddddd" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats f cuts excessive digits and keeps only 6 ones" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats f displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats f displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats f rounds the last significant digit to the closest one" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g displays Float::INFINITY as Inf" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g displays Float::NAN as NaN" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g otherwise converts a floating point number in dd.dddd form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g otherwise cuts fraction part to have only 6 digits at all" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g otherwise rounds the last significant digit to the closest one in fractional part" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats g the exponent is less than -4 converts a floating point number using exponential form" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified float formats raises TypeError exception if cannot convert to Float" # Expected TypeError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified integer formats B collapse negative number representation if it equals 1" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats B converts argument as a binary number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats B displays negative number as a two's complement prefixed with '..1'" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats X collapse negative number representation if it equals F" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats X converts argument as a hexadecimal number with uppercase letters" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats X displays negative number as a two's complement prefixed with '..f'" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats b collapse negative number representation if it equals 1" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats b converts argument as a binary number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats b displays negative number as a two's complement prefixed with '..1'" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats converts String argument with Kernel#Integer" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats converts argument into Integer with to_i if to_int isn't available" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats converts argument into Integer with to_int" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats d converts argument as a decimal number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats d works well with large numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats i converts argument as a decimal number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats i works well with large numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats o collapse negative number representation if it equals 7" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats o converts argument as an octal number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats o displays negative number as a two's complement prefixed with '..7'" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats raises TypeError exception if cannot convert to Integer" # Expected TypeError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified integer formats u converts argument as a decimal number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats u works well with large numbers" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats x collapse negative number representation if it equals f" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats x converts argument as a hexadecimal number" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified integer formats x displays negative number as a two's complement prefixed with '..f'" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats % alone raises an ArgumentError" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified other formats % is escaped by %" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats c displays character if argument is a numeric code of character" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats c displays character if argument is a single character string" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats c raises ArgumentError if argument is a string of several characters" # Expected ArgumentError (/%c requires a character/) but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified other formats c raises ArgumentError if argument is an empty string" # Expected ArgumentError (/%c requires a character/) but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified other formats p displays argument.inspect value" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats s converts argument to string with to_s" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified other formats s does not try to convert with to_str" # Expected NoMethodError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified other formats s substitute argument passes as a string" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified precision float types controls the number of decimal places displayed in fraction part" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified precision float types does not affect G format" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified precision integer types controls the number of decimal places displayed" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified precision string formats determines the maximum number of characters to be copied from the string" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %<name>s style allows to place name in any position" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %<name>s style cannot be mixed with unnamed style" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified reference by name %<name>s style supports flags, width, precision and type" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %<name>s style uses value passed in a hash argument" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %{name} style cannot be mixed with unnamed style" # Expected ArgumentError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified reference by name %{name} style converts value to String with to_s" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %{name} style does not support type style" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %{name} style raises KeyError when there is no matching key" # Expected KeyError but got: Exception (format_string.indexOf is not a function) fails "Kernel.printf formatting io is specified reference by name %{name} style supports flags, width and precision" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified reference by name %{name} style uses value passed in a hash argument" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified width is ignored if argument's actual length is greater" # Exception: format_string.indexOf is not a function fails "Kernel.printf formatting io is specified width specifies the minimum number of characters that will be written to the result" # Exception: format_string.indexOf is not a function fails "The BEGIN keyword returns the top-level script's filename for __FILE__" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xab0bc> fails "The return keyword at top level file loading stops file loading and execution" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level file requiring stops file loading and execution" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level stops file execution" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8> fails "The return keyword at top level within a begin fires ensure block before returning while loads file" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a begin fires ensure block before returning" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a begin is allowed in begin block" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a begin is allowed in ensure block" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a begin is allowed in rescue block" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a begin swallows exception if returns in ensure block" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a block is allowed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within a class raises a SyntaxError" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within if is allowed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> fails "The return keyword at top level within while loop is allowed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6bbf8 @filename=nil> end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/enumerator.rb
spec/filters/unsupported/enumerator.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Enumerator" do fails "Enumerator#rewind calls the enclosed object's rewind method if one exists" # Mock 'rewinder' expected to receive rewind("any_args") exactly 1 times but received it 0 times fails "Enumerator#rewind clears a pending #feed value" # NotImplementedError: Opal doesn't support Enumerator#feed end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/class.rb
spec/filters/unsupported/class.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Class" do fails "Class#initialize is private" # Expected Class to have private method 'initialize' but it does not end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/string.rb
spec/filters/unsupported/string.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "String" do fails "BasicObject#__id__ returns a different value for two String literals" # Expected "hello" == "hello" to be falsy but was true fails "Module#const_defined? returns true when passed a constant name with EUC-JP characters" # ArgumentError: unknown encoding name - euc-jp fails "String#% supports negative bignums with %u or %d" # Expected "-18446744073709552000" == "-18446744073709551621" to be truthy but was false fails "String#<< concatenates the given argument to self and returns self" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< converts the given argument to a String using to_str" # Mock 'world!' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#<< raises a TypeError if the given argument can't be converted to a String" # Expected TypeError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< raises an ArgumentError when given the incorrect number of arguments" # Expected ArgumentError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< returns a String when given a subclass instance" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< returns an instance of same class when called on a subclass" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when self and the argument are in different ASCII-compatible encodings raises Encoding::CompatibilityError if neither are ASCII-only" # Expected CompatibilityError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< when self and the argument are in different ASCII-compatible encodings uses self's encoding if both are ASCII-only" # ArgumentError: unknown encoding name - SHIFT_JIS fails "String#<< when self and the argument are in different ASCII-compatible encodings uses self's encoding if the argument is ASCII-only" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when self and the argument are in different ASCII-compatible encodings uses the argument's encoding if self is ASCII-only" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when self is in an ASCII-incompatible encoding incompatible with the argument's encoding raises Encoding::CompatibilityError if neither are empty" # Expected CompatibilityError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses self's encoding if both are empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses self's encoding if the argument is empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses the argument's encoding if self is empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when the argument is in an ASCII-incompatible encoding incompatible with self's encoding raises Encoding::CompatibilityError if neither are empty" # Expected CompatibilityError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses self's encoding if both are empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses self's encoding if the argument is empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses the argument's encoding if self is empty" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< with Integer concatenates the argument interpreted as a codepoint" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "String#<< with Integer doesn't call to_int on its argument" # Expected TypeError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< with Integer raises RangeError if the argument is an invalid codepoint for self's encoding" # Expected RangeError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#<< with Integer raises RangeError if the argument is negative" # Expected RangeError but got: NotImplementedError (String#<< not supported. Mutable String methods are not supported in Opal.) fails "String#[] with Symbol raises TypeError" # Expected TypeError but no exception was raised ("hello" was returned) fails "String#[]= with Integer index allows assignment to the zero'th element of an empty String" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index calls #to_int to convert the index" # Mock 'string element set' expected to receive to_int("any_args") exactly 1 times but received it 0 times fails "String#[]= with Integer index calls #to_str to convert other to a String" # Mock '-test-' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#[]= with Integer index calls to_int on index" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index encodes the String in an encoding compatible with the replacement" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index raises IndexError if the string index doesn't match a position in the string" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises a FrozenError when self is frozen" # Expected FrozenError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises a TypeError if #to_int does not return an Integer" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises a TypeError if other_str can't be converted to a String" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises a TypeError if passed an Integer replacement" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises an Encoding::CompatibilityError if the replacement encoding is incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#[]= with Integer index raises an IndexError if #to_int returns a value out of range" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises an IndexError if the index is greater than character size" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index raises an IndexError without changing self if idx is outside of self" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index replaces a character with a multibyte character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index replaces a multibyte character with a character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index replaces a multibyte character with a multibyte character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index replaces the char at idx with other_str" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index updates the string to a compatible encoding" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count appends other_str to the end of the string if idx == the length of the string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count calls #to_int to convert the index and count objects" # Mock 'string element set index' expected to receive to_int("any_args") exactly 1 times but received it 0 times fails "String#[]= with Integer index, count calls #to_str to convert the replacement object" # Mock 'string element set replacement' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#[]= with Integer index, count counts negative idx values from end of the string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count deletes a multibyte character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count deletes characters if other_str is an empty string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count deletes characters up to the maximum length of the existing string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count encodes the String in an encoding compatible with the replacement" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count inserts a multibyte character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count overwrites and deletes characters if count is more than the length of other_str" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count raises a TypeError if #to_int for count does not return an Integer" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises a TypeError if #to_int for index does not return an Integer" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises a TypeError if other_str is a type other than String" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises a TypeError of #to_str does not return a String" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises an Encoding::CompatibilityError if the replacement encoding is incompatible" # NameError: uninitialized constant Encoding::EUC_JP fails "String#[]= with Integer index, count raises an IndexError if count < 0" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises an IndexError if the character index is out of range of a multibyte String" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count raises an IndexError if |idx| is greater than the length of the string" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with Integer index, count replaces characters with a multibyte character" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count replaces multibyte characters with characters" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count replaces multibyte characters with multibyte characters" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with Integer index, count starts at idx and overwrites count characters before inserting the rest of other_str" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with String index raises an IndexError if the search String is not found" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with String index replaces characters with no characters" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with String index replaces fewer characters with more characters" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with String index replaces more characters with fewer characters" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index raises a RangeError if negative Range begin is out of range" # Expected RangeError (-4..-2 out of range) but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Range index raises a RangeError if positive Range begin is greater than String size" # Expected RangeError (4..2 out of range) but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Range index replaces a partial string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index replaces the contents with a longer String" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index replaces the contents with a shorter String" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index treats a negative out-of-range Range end with a negative Range begin as a zero count" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index treats a negative out-of-range Range end with a positive Range begin as a zero count" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index uses the Range end as an index rather than a count" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero exclude-end range" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero-index, zero exclude-end range" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index with an empty replacement replaces a character with a zero non-exclude-end range" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Range index with an empty replacement replaces a character with zero-index, zero non-exclude-end range" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Regexp index calls #to_str to convert the replacement" # Mock 'string element set regexp' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#[]= with a Regexp index checks the match before calling #to_str to convert the replacement" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Regexp index raises IndexError if the regexp index doesn't match a position in the string" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Regexp index replaces the matched text with the rhs" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Regexp index with 3 arguments allows the specified capture to be negative and count from the end" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Regexp index with 3 arguments calls #to_int to convert the second object" # Mock 'string element set regexp ref' expected to receive to_int("any_args") exactly 1 times but received it 0 times fails "String#[]= with a Regexp index with 3 arguments checks the match index before calling #to_str to convert the replacement" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Regexp index with 3 arguments raises IndexError if the specified capture isn't available" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Regexp index with 3 arguments raises a TypeError if #to_int does not return an Integer" # Expected TypeError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#[]= with a Regexp index with 3 arguments uses the 2nd of 3 arguments as which capture should be replaced" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#[]= with a Regexp index with 3 arguments when the optional capture does not match raises an IndexError before setting the replacement" # Expected IndexError but got: NotImplementedError (String#[]= not supported. Mutable String methods are not supported in Opal.) fails "String#capitalize! capitalizes self in place" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! does not allow invalid options" # Expected ArgumentError but got: NotImplementedError (String#capitalize! not supported. Mutable String methods are not supported in Opal.) fails "String#capitalize! does not allow the :fold option for upcasing" # Expected ArgumentError but got: NotImplementedError (String#capitalize! not supported. Mutable String methods are not supported in Opal.) fails "String#capitalize! full Unicode case mapping modifies self in place for all of Unicode with no option" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! full Unicode case mapping only capitalizes the first resulting character when upcasing a character produces a multi-character sequence" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! full Unicode case mapping updates string metadata" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! full Unicode case mapping works for non-ascii-compatible encodings" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for ASCII-only case mapping does not capitalize non-ASCII characters" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for ASCII-only case mapping works for non-ascii-compatible encodings" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Lithuanian allows Turkic as an extra option (and applies Turkic semantics)" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Lithuanian currently works the same as full Unicode case mapping" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Lithuanian does not allow any other additional option" # Expected ArgumentError but got: NotImplementedError (String#capitalize! not supported. Mutable String methods are not supported in Opal.) fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Turkic languages allows Lithuanian as an extra option" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Turkic languages capitalizes ASCII characters according to Turkic semantics" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! modifies self in place for full Unicode case mapping adapted for Turkic languages does not allow any other additional option" # Expected ArgumentError but got: NotImplementedError (String#capitalize! not supported. Mutable String methods are not supported in Opal.) fails "String#capitalize! modifies self in place for non-ascii-compatible encodings" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#capitalize! returns nil when no changes are made" # NotImplementedError: String#capitalize! not supported. Mutable String methods are not supported in Opal. fails "String#chomp when passed nil returns a copy of the String" # Expected "abc" not to be identical to "abc" fails "String#chomp! removes the final carriage return, newline from a multibyte String" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! removes the final carriage return, newline from a non-ASCII String when the record separator is changed" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! removes the final carriage return, newline from a non-ASCII String" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! returns nil when the String is not modified" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' does not remove a final carriage return" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' removes a final carriage return, newline" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' removes a final newline" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' removes more than one trailing carriage return, newline pairs" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' removes more than one trailing newlines" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '' returns nil when self is empty" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '\\n' removes one trailing carriage return" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '\\n' removes one trailing carriage return, newline pair" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '\\n' removes one trailing newline" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed '\\n' returns nil when self is empty" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed a String removes the trailing characters if they match the argument" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed a String returns nil if the argument does not match the trailing characters" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed a String returns nil when self is empty" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed an Object calls #to_str to convert to a String" # Mock 'string chomp' expected to receive to_str("any_args") exactly 1 times but received it 0 times fails "String#chomp! when passed an Object raises a TypeError if #to_str does not return a String" # Expected TypeError but got: NotImplementedError (String#chomp! not supported. Mutable String methods are not supported in Opal.) fails "String#chomp! when passed nil returns nil when self is empty" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed nil returns nil" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument modifies self" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument removes one trailing carriage return" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument removes one trailing carriage return, newline pair" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument removes one trailing newline" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument removes trailing characters that match $/ when it has been assigned a value" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument returns nil if self is not modified" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument returns nil when self is empty" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chomp! when passed no argument returns subclass instances when called on a subclass" # NotImplementedError: String#chomp! not supported. Mutable String methods are not supported in Opal. fails "String#chop returns a new string when applied to an empty string" # Expected "" not to be identical to "" fails "String#chop! does not remove more than the final carriage return, newline" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes a multi-byte character" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the carriage return, newline if they are the only characters" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final carriage return" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final carriage return, newline from a multibyte String" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final carriage return, newline from a non-ASCII String" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final carriage return, newline" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final character" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! removes the final newline" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! returns nil when called on an empty string" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#chop! returns self if modifications were made" # NotImplementedError: String#chop! not supported. Mutable String methods are not supported in Opal. fails "String#clear preserves its encoding" # NameError: uninitialized constant Encoding::SHIFT_JIS fails "String#clear returns self after emptying it" # NotImplementedError: String#clear not supported. Mutable String methods are not supported in Opal. fails "String#clear sets self equal to the empty String" # NotImplementedError: String#clear not supported. Mutable String methods are not supported in Opal. fails "String#clear works with multibyte Strings" # NotImplementedError: String#clear not supported. Mutable String methods are not supported in Opal. fails "String#clone copies instance variables" # NoMethodError: undefined method `ivar' for "string" fails "String#clone does not modify the original string when changing cloned string" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. fails "String#concat concatenates the given argument to self and returns self" # NoMethodError: undefined method `concat' for "hello "
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
true
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/matchdata.rb
spec/filters/unsupported/matchdata.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "MatchData" do fails "MatchData#[Symbol] returns matches in the String's encoding" # ArgumentError: unknown encoding name - euc-jp fails "MatchData#[Symbol] returns the last match when multiple named matches exist with the same name" # Exception: Invalid regular expression: /(?<word>hay)(?<word>stack)/: Duplicate capture group name fails "MatchData#[Symbol] returns the matching version of multiple corresponding named match" # Exception: Invalid regular expression: /(?:A(?<word>\w+)|B(?<word>\w+))/: Duplicate capture group name fails "MatchData#begin when passed a String argument return the character offset of the start of the named capture" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a String argument returns the character offset for multi byte strings" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a String argument returns the character offset for multi-byte names" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a String argument returns the character offset for the farthest match when multiple named captures use the same name" # Exception: Invalid regular expression: /(?<a>.)(.)(?<a>\d+)(\d)/: Duplicate capture group name fails "MatchData#begin when passed a Symbol argument return the character offset of the start of the named capture" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a Symbol argument returns the character offset for multi byte strings" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a Symbol argument returns the character offset for multi-byte names" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed a Symbol argument returns the character offset for the farthest match when multiple named captures use the same name" # Exception: Invalid regular expression: /(?<a>.)(.)(?<a>\d+)(\d)/: Duplicate capture group name fails "MatchData#begin when passed an integer argument returns nil when the nth match isn't found" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed an integer argument returns the character offset for multi-byte strings" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed an integer argument returns the character offset of the start of the nth element" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#begin when passed an integer argument tries to convert the passed argument to an Integer using #to_int" # ArgumentError: MatchData#begin only supports 0th element fails "MatchData#end when passed a String argument return the character offset of the start of the named capture" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a String argument returns the character offset for multi byte strings" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a String argument returns the character offset for multi-byte names" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a String argument returns the character offset for the farthest match when multiple named captures use the same name" # Exception: Invalid regular expression: /(?<a>.)(.)(?<a>\d+)(\d)/: Duplicate capture group name fails "MatchData#end when passed a Symbol argument return the character offset of the start of the named capture" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a Symbol argument returns the character offset for multi byte strings" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a Symbol argument returns the character offset for multi-byte names" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed a Symbol argument returns the character offset for the farthest match when multiple named captures use the same name" # Exception: Invalid regular expression: /(?<a>.)(.)(?<a>\d+)(\d)/: Duplicate capture group name fails "MatchData#end when passed an integer argument returns nil when the nth match isn't found" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed an integer argument returns the character offset for multi-byte strings" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed an integer argument returns the character offset of the end of the nth element" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#end when passed an integer argument tries to convert the passed argument to an Integer using #to_int" # ArgumentError: MatchData#end only supports 0th element fails "MatchData#named_captures prefers later captures" # Exception: Invalid regular expression: /^(?<a>.)(?<b>.)(?<b>.)(?<a>.)$/: Duplicate capture group name fails "MatchData#named_captures returns the latest matched capture, even if a later one that does not match exists" # Exception: Invalid regular expression: /^(?<a>.)(?<b>.)(?<b>.)(?<a>.)?$/: Duplicate capture group name fails "MatchData#names equals Regexp#names" # Exception: Invalid regular expression: /(?<hay>hay)(?<dot>.)(?<hay>tack)/: Duplicate capture group name fails "MatchData#names returns each name only once" # Exception: Invalid regular expression: /(?<hay>hay)(?<dot>.)(?<hay>tack)/: Duplicate capture group name fails "MatchData#offset returns [nil, nil] when the nth match isn't found" # ArgumentError: MatchData#offset only supports 0th element fails "MatchData#offset returns a two element array with the begin and end of the nth match" # ArgumentError: MatchData#offset only supports 0th element fails "MatchData#offset returns the offset for multi byte strings" # ArgumentError: MatchData#offset only supports 0th element fails "MatchData#values_at slices captures with the given names" # TypeError: no implicit conversion of String into Integer fails "MatchData#values_at takes names and indices" # TypeError: no implicit conversion of String into Integer end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/enumerable.rb
spec/filters/unsupported/enumerable.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Enumerable" do fails "Enumerable#chunk does not return elements for which the block returns :_separator" # Expected [[1, [1]], ["_separator", [2]], [1, [3, 3]], ["_separator", [2]], [1, [1]]] == [[1, [1]], [1, [3, 3]], [1, [1]]] to be truthy but was false fails "Enumerable#chunk raises a RuntimeError if the block returns a Symbol starting with an underscore other than :_alone or :_separator" # Expected RuntimeError but no exception was raised ([["_arbitrary", [1, 2, 3, 2, 1]]] was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/integer.rb
spec/filters/unsupported/integer.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Integer" do fails "Integer#% bignum returns the modulus obtained from dividing self by the given argument" # Expected 0 == 18446744073709552000 to be truthy but was false fails "Integer#& bignum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (0 was returned) fails "Integer#& bignum returns self bitwise AND other when both operands are negative" # Expected 0 == -23058430092136940000 to be truthy but was false fails "Integer#& bignum returns self bitwise AND other when one operand is negative" # Expected 0 == 36893488147419103000 to be truthy but was false fails "Integer#& bignum returns self bitwise AND other" # Expected 0 == 1 to be truthy but was false fails "Integer#& fixnum returns self bitwise AND a bignum" # Expected 0 == 18446744073709552000 to be truthy but was false fails "Integer#& fixnum returns self bitwise AND other" # Expected 0 == 65535 to be truthy but was false fails "Integer#** fixnum can raise -1 to a bignum safely" # Expected 1 to have same value and type as -1 fails "Integer#- bignum returns self minus the given Integer" # Expected 0 == 272 to be truthy but was false fails "Integer#/ bignum raises a ZeroDivisionError if other is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "Integer#/ bignum returns self divided by other" # Expected 10000000000 == 9999999999 to be truthy but was false fails "Integer#< bignum returns true if self is less than the given argument" # Expected false == true to be truthy but was false fails "Integer#<< (with n << m) bignum calls #to_int to convert the argument to an Integer" # Expected 0 == 2.3611832414348226e+21 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n shifted left m bits when n < 0, m > 0" # Expected 0 == -7.555786372591432e+22 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n shifted left m bits when n > 0, m > 0" # Expected 0 == 2.3611832414348226e+21 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n shifted right m bits when n < 0, m < 0" # Expected 0 == -36893488147419103000 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n shifted right m bits when n > 0, m < 0" # Expected 0 == 73786976294838210000 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n when n < 0, m == 0" # Expected 0 == -147573952589676410000 to be truthy but was false fails "Integer#<< (with n << m) bignum returns n when n > 0, m == 0" # Expected 0 == 147573952589676410000 to be truthy but was false fails "Integer#<< (with n << m) fixnum returns 0 when m < 0 and m is a Bignum" # Expected 3 == 0 to be truthy but was false fails "Integer#<= bignum returns false if compares with near float" # Expected true == false to be truthy but was false fails "Integer#<=> bignum returns -1 when self is -Infinity and other is negative" # Expected 0 == -1 to be truthy but was false fails "Integer#<=> bignum returns 1 when self is Infinity and other is a Bignum" # Expected 0 == 1 to be truthy but was false fails "Integer#<=> bignum returns 1 when self is negative and other is -Infinity" # Expected 0 == 1 to be truthy but was false fails "Integer#<=> bignum with a Bignum when other is negative returns -1 when self is negative and other is larger" # Expected 0 == -1 to be truthy but was false fails "Integer#<=> bignum with a Bignum when other is negative returns 1 when self is negative and other is smaller" # Expected 0 == 1 to be truthy but was false fails "Integer#<=> bignum with a Bignum when other is positive returns -1 when self is positive and other is larger" # Expected 0 == -1 to be truthy but was false fails "Integer#<=> bignum with a Bignum when other is positive returns 1 when other is smaller" # Expected 0 == 1 to be truthy but was false fails "Integer#<=> bignum with an Object returns -1 if the coerced value is larger" # Expected 0 == -1 to be truthy but was false fails "Integer#<=> bignum with an Object returns nil if #coerce does not return an Array" # Expected 0 to be nil fails "Integer#== bignum returns the result of 'other == self' as a boolean" # Expected "woot" == true to be truthy but was false fails "Integer#== bignum returns true if self has the same value as the given argument" # Expected true == false to be truthy but was false fails "Integer#=== bignum returns the result of 'other == self' as a boolean" # Expected "woot" == true to be truthy but was false fails "Integer#=== bignum returns true if self has the same value as the given argument" # Expected true == false to be truthy but was false fails "Integer#> bignum returns true if self is greater than the given argument" # Expected false == true to be truthy but was false fails "Integer#>= bignum returns true if self is greater than or equal to other" # Expected true == false to be truthy but was false fails "Integer#>> (with n >> m) bignum calls #to_int to convert the argument to an Integer" # Expected 0 == 36893488147419103000 to be truthy but was false fails "Integer#>> (with n >> m) bignum respects twos complement signed shifting for very large values" # Expected 0 == 2.2204460502842888e+66 to be truthy but was false fails "Integer#>> (with n >> m) bignum respects twos complement signed shifting" # Expected 101376 == -2621440001220703000 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n shifted left m bits when n < 0, m < 0" # Expected 0 == -1.1805916207174113e+21 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n shifted left m bits when n > 0, m < 0" # Expected 0 == 590295810358705700000 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n shifted right m bits when n < 0, m > 0" # Expected 0 == -36893488147419103000 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n shifted right m bits when n > 0, m > 0" # Expected 0 == 73786976294838210000 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n when n < 0, m == 0" # Expected 0 == -147573952589676410000 to be truthy but was false fails "Integer#>> (with n >> m) bignum returns n when n > 0, m == 0" # Expected 0 == 147573952589676410000 to be truthy but was false fails "Integer#[] bignum returns the nth bit in the binary representation of self" # Expected 0 == 1 to be truthy but was false fails "Integer#[] bignum tries to convert the given argument to an Integer using #to_int" # Expected 0 == 1 to be truthy but was false fails "Integer#^ bignum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (14 was returned) fails "Integer#^ bignum returns self bitwise EXCLUSIVE OR other when all bits are 1 and other value is negative" # Expected -1 == -9.903520314283042e+27 to be truthy but was false fails "Integer#^ bignum returns self bitwise EXCLUSIVE OR other when both operands are negative" # Expected 0 == 55340232221128655000 to be truthy but was false fails "Integer#^ bignum returns self bitwise EXCLUSIVE OR other when one operand is negative" # Expected 0 == -55340232221128655000 to be truthy but was false fails "Integer#^ bignum returns self bitwise EXCLUSIVE OR other" # Expected 2 == 18446744073709552000 to be truthy but was false fails "Integer#^ fixnum returns self bitwise EXCLUSIVE OR a bignum" # Expected -1 == -18446744073709552000 to be truthy but was false fails "Integer#bit_length bignum returns the position of the leftmost 0 bit of a negative number" # NoMethodError: undefined method `bit_length` for -Infinity:Float fails "Integer#bit_length bignum returns the position of the leftmost bit of a positive number" # Expected 1 == 1000 to be truthy but was false fails "Integer#coerce bignum raises a TypeError when not passed a Fixnum or Bignum" # Expected TypeError but got: ArgumentError (invalid value for Float(): "test") fails "Integer#div bignum calls #coerce and #div if argument responds to #coerce" # Mock 'x' expected to receive div(#<MockObject:0x4098c @name="y" @null=nil>) exactly 1 times but received it 0 times fails "Integer#div bignum looses precision if passed Float argument" # Expected 18446744073709552000 == 18446744073709552000 to be falsy but was true fails "Integer#div bignum returns self divided by other" # Expected 10000000000 == 9999999999 to be truthy but was false fails "Integer#divmod bignum raises a TypeError when the given argument is not an Integer" # Expected TypeError but got: NoMethodError (undefined method `nan?' for #<MockObject:0x438bc @name="10" @null=nil>) fails "Integer#divmod bignum returns an Array containing quotient and modulus obtained from dividing self by the given argument" # Expected [4611686018427388000, 0] == [4611686018427388000, 3] to be truthy but was false fails "Integer#divmod bignum with q = floor(x/y), a = q*b + r, returns [q,r] when a < 0, b < 0 and |a| < |b|" # Expected [1, -0.0] == [0, -18446744073709552000] to be truthy but was false fails "Integer#divmod bignum with q = floor(x/y), a = q*b + r, returns [q,r] when a < 0, b > 0 and |a| < b" # Expected [-1, 0] == [-1, 1] to be truthy but was false fails "Integer#divmod bignum with q = floor(x/y), a = q*b + r, returns [q,r] when a > 0, b < 0 and a < |b|" # Expected [-1, -0.0] == [-1, -1] to be truthy but was false fails "Integer#divmod bignum with q = floor(x/y), a = q*b + r, returns [q,r] when a > 0, b < 0 and a > |b|" # Expected [-1, -0.0] == [-2, -18446744073709552000] to be truthy but was false fails "Integer#even? fixnum returns true for a Bignum when it is an even number" # Expected true to be false fails "Integer#modulo bignum returns the modulus obtained from dividing self by the given argument" # Expected 0 == 18446744073709552000 to be truthy but was false fails "Integer#odd? bignum returns false if self is even and negative" # Expected true to be false fails "Integer#odd? bignum returns true if self is odd and positive" # Expected false to be true fails "Integer#pow one argument is passed 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: "" fails "Integer#pow one argument is passed fixnum can raise -1 to a bignum safely" # Expected 1 to have same value and type as -1 fails "Integer#pow one argument is passed fixnum returns Float::INFINITY for 0 ** -1.0" # ZeroDivisionError: divided by 0 fails "Integer#pow two arguments are passed ensures all arguments are integers" # Expected TypeError (/2nd argument not allowed unless all arguments are integers/) but no exception was raised (8 was returned) fails "Integer#remainder bignum does raises ZeroDivisionError if other is zero and a Float" # Expected ZeroDivisionError but no exception was raised (NaN was returned) fails "Integer#remainder bignum raises a ZeroDivisionError if other is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (NaN was returned) fails "Integer#remainder bignum returns the remainder of dividing self by other" # Expected 0 == 1 to be truthy but was false fails "Integer#size bignum returns the number of bytes required to hold the unsigned bignum data" # Expected 4 == 8 to be truthy but was false fails "Integer#| bignum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (9 was returned) fails "Integer#| bignum returns self bitwise OR other when both operands are negative" # Expected 0 == -1 to be truthy but was false fails "Integer#| bignum returns self bitwise OR other when one operand is negative" # Expected 0 == -55340232221128655000 to be truthy but was false fails "Integer#| bignum returns self bitwise OR other" # Expected 2 == 18446744073709552000 to be truthy but was false fails "Integer#~ bignum returns self with each bit flipped" # Expected -1 == -18446744073709552000 to be truthy but was false fails "Numeric#quo raises a ZeroDivisionError if the given argument is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (Infinity was returned) fails "String#to_r ignores underscores between numbers" # Expected (-5228919960423629/274877906944) == (-190227/10) to be truthy but was false fails "String#to_r understands a forward slash as separating the numerator from the denominator" # Expected (-896028675862255/140737488355328) == (-191/30) to be truthy but was false fails "String#to_r understands decimal points" # Expected (1874623344892969/562949953421312) == (333/100) to be truthy but was false end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/regexp.rb
spec/filters/unsupported/regexp.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Regexp" do fails "Regexp#options does not include Regexp::FIXEDENCODING for a Regexp literal with the 'n' option" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Regexp#options includes Regexp::FIXEDENCODING for a Regexp literal with the 'e' option" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Regexp#options includes Regexp::FIXEDENCODING for a Regexp literal with the 's' option" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Regexp#options includes Regexp::FIXEDENCODING for a Regexp literal with the 'u' option" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Regexp#options includes Regexp::NOENCODING for a Regexp literal with the 'n' option" # NameError: uninitialized constant Regexp::NOENCODING fails "Regexp.escape sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String" # ArgumentError: unknown encoding name - euc-jp fails "Regexp.new given a String ignores the third argument if it is 'e' or 'euc' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2) fails "Regexp.new given a String ignores the third argument if it is 's' or 'sjis' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2) fails "Regexp.new given a String ignores the third argument if it is 'u' or 'utf8' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2) fails "Regexp.new given a String uses ASCII_8BIT encoding if third argument is 'n' or 'none' (case insensitive) and non-ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2) fails "Regexp.new given a String uses US_ASCII encoding if third argument is 'n' or 'none' (case insensitive) and only ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2) fails "Regexp.new given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH" # Expected RegexpError but no exception was raised (/\u304/ was returned) fails "Regexp.new given a String with escaped characters raises a RegexpError if the \\u{} escape is empty" # Expected RegexpError but no exception was raised (/\u{}/ was returned) fails "Regexp.new given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /a/ fails "Regexp.new given a String with escaped characters returns a Regexp with US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # NoMethodError: undefined method `encoding' for /abc/ fails "Regexp.new given a String with escaped characters returns a Regexp with UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /ÿ/ fails "Regexp.new given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Regexp.new given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false fails "Regexp.new given a String with escaped characters returns a Regexp with source String having the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS fails "Regexp.new given a String with escaped characters returns a Regexp with the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS fails "Regexp.quote sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String" # ArgumentError: unknown encoding name - euc-jp fails "Regexp.union raises ArgumentError if the arguments include a String containing non-ASCII-compatible characters and a fixed encoding Regexp in a different encoding" # Expected ArgumentError but got: NameError (uninitialized constant Regexp::FIXEDENCODING) fails "Regexp.union raises ArgumentError if the arguments include a fixed encoding Regexp and a String containing non-ASCII-compatible characters in a different encoding" # Expected ArgumentError but got: NameError (uninitialized constant Regexp::FIXEDENCODING) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible Regexp and a Regexp containing non-ASCII-compatible characters in a different encoding" # Expected ArgumentError but no exception was raised (/(a)|(©)/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible Regexp and a String containing non-ASCII-compatible characters in a different encoding" # Expected ArgumentError but no exception was raised (/(a)|©/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible Regexp and an ASCII-only Regexp" # Expected ArgumentError but no exception was raised (/(a)|(b)/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible Regexp and an ASCII-only String" # Expected ArgumentError but no exception was raised (/(a)|b/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible String and a Regexp containing non-ASCII-compatible characters in a different encoding" # Expected ArgumentError but no exception was raised (/a|(©)/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible String and a String containing non-ASCII-compatible characters in a different encoding" # Expected ArgumentError but no exception was raised (/a|©/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible String and an ASCII-only Regexp" # Expected ArgumentError but no exception was raised (/a|(b)/ was returned) fails "Regexp.union raises ArgumentError if the arguments include an ASCII-incompatible String and an ASCII-only String" # Expected ArgumentError but no exception was raised (/a|b/ was returned) fails "Regexp.union raises ArgumentError if the arguments include conflicting ASCII-incompatible Regexps" # Expected ArgumentError but no exception was raised (/(a)|(b)/ was returned) fails "Regexp.union raises ArgumentError if the arguments include conflicting ASCII-incompatible Strings" # Expected ArgumentError but no exception was raised (/a|b/ was returned) fails "Regexp.union raises ArgumentError if the arguments include conflicting fixed encoding Regexps" # Expected ArgumentError but got: NameError (uninitialized constant Regexp::FIXEDENCODING) fails "Regexp.union returns a Regexp with US-ASCII encoding if all arguments are ASCII-only" # ArgumentError: unknown encoding name - SJIS fails "Regexp.union returns a Regexp with UTF-8 if one part is UTF-8" # NoMethodError: undefined method `encoding' for /(probl[éeè]me)|(help)/i fails "Regexp.union returns a Regexp with the encoding of a String containing non-ASCII-compatible characters and another ASCII-only String" # NoMethodError: undefined method `encoding' for /©|a/ fails "Regexp.union returns a Regexp with the encoding of a String containing non-ASCII-compatible characters" # NoMethodError: undefined method `encoding' for /©/ fails "Regexp.union returns a Regexp with the encoding of an ASCII-incompatible String argument" # NoMethodError: undefined method `encoding' for /a/ fails "Regexp.union returns a Regexp with the encoding of multiple non-conflicting ASCII-incompatible String arguments" # NoMethodError: undefined method `encoding' for /a|b/ fails "Regexp.union returns a Regexp with the encoding of multiple non-conflicting Strings containing non-ASCII-compatible characters" # NoMethodError: undefined method `encoding' for /©|°/ end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/marshal.rb
spec/filters/unsupported/marshal.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Marshal" do fails "Marshal.dump dumps subsequent appearances of a symbol as a link" # Expected "\x04\b[\a\"\x06a@\x06" == "\x04\b[\a:\x06a;\x00" to be truthy but was false fails "Marshal.dump raises a TypeError if dumping a IO/File instance" # Expected TypeError but got: Exception (Maximum call stack size exceeded) fails "Marshal.dump when passed an IO raises an Error when the IO-Object does not respond to #write" # Expected TypeError but got: ArgumentError ([Marshal.dump] wrong number of arguments (given 2, expected 1)) fails "Marshal.dump when passed an IO returns the IO-Object" # ArgumentError: [Marshal.dump] wrong number of arguments (given 2, expected 1) fails "Marshal.dump when passed an IO writes the serialized data to the IO-Object" # ArgumentError: [Marshal.dump] wrong number of arguments (given 2, expected 1) fails "Marshal.dump with a Float dumps a Float" # Expected "\x04\bf\x060" to be computed by Marshal.dump from 0 (computed "\x04\bi\x00" instead) fails "Marshal.dump with a Regexp dumps a Regexp in another encoding" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Marshal.dump with a Regexp dumps a Regexp with flags" # Expected "\x04\b/\t(?:)\x00" == "\x04\bI/\x00\x05\x06:\x06EF" to be truthy but was false fails "Marshal.dump with a Regexp dumps a Regexp" # Expected "\x04\b/\t^.\\Z\x00" == "\x04\bI/ \\A.\\Z\x00\x06:\x06EF" to be truthy but was false fails "Marshal.dump with a Regexp dumps a UTF-8 Regexp" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Marshal.dump with a Regexp dumps a binary Regexp" # NameError: uninitialized constant Regexp::FIXEDENCODING fails "Marshal.dump with a Regexp dumps an extended Regexp" # Expected "\x04\be: Meths/\t(?:)\x00" == "\x04\bIe: Meths/\x00\x00\x06:\x06EF" to be truthy but was false fails "Marshal.dump with a String dumps a String with instance variables" # Expected "\x04\b\"\x00" == "\x04\bI\"\x00\x06:\t@foo\"\bbar" to be truthy but was false fails "Marshal.dump with an object responding to #marshal_dump dumps the object returned by #marshal_dump" # Expected "\x04\bU:\x10UserMarshal\"\tdata" == "\x04\bU:\x10UserMarshal:\tdata" to be truthy but was false fails "Marshal.load for a Hash preserves hash ivars when hash contains a string having ivar" # Expected nil == "string ivar" to be truthy but was false fails "Marshal.load for a String loads a string through StringIO stream" # TypeError: incompatible marshal file format (can't be read) fails "Marshal.load for a wrapped C pointer loads" # NotImplementedError: Data type cannot be demarshaled fails "Marshal.load for a wrapped C pointer raises ArgumentError when the local class is a regular object" # Expected ArgumentError but got: NotImplementedError (Data type cannot be demarshaled) fails "Marshal.load for a wrapped C pointer raises TypeError when the local class is missing _load_data" # Expected TypeError but got: NotImplementedError (Data type cannot be demarshaled) fails "Marshal.load loads a Random" # ArgumentError: marshal data too short fails "Marshal.load raises EOFError on loading an empty file" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x444da @method="load" @object=nil @num_self_class=1 @data="\x04\bo:\x1ANamespaceTest::KaBoom\x00"> fails "Marshal.load raises a TypeError with bad Marshal version" # NotImplementedError: String#[]= not supported. Mutable String methods are not supported in Opal. end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/hash.rb
spec/filters/unsupported/hash.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Hash" do fails "Hash#[] compares key via hash" # Mock '0' expected to receive hash("any_args") exactly 1 times but received it 0 times (performance optimization) fails "Hash#[]= duplicates and freezes string keys" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "Hash#[]= duplicates string keys using dup semantics" # TypeError: can't define singleton fails "Hash#assoc only returns the first matching key-value pair for identity hashes" # Expected 1 == 2 to be truthy but was false fails "Hash#initialize is private" # Expected Hash to have private instance method 'initialize' but it does not fails "Hash#inspect does not raise if inspected result is not default external encoding" # Mock 'utf_16be' expected to receive inspect("any_args") exactly 1 times but received it 0 times fails "Hash#store duplicates and freezes string keys" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal. fails "Hash#store duplicates string keys using dup semantics" # TypeError: can't define singleton fails "Hash#to_proc the returned proc passed as a block to instance_exec always retrieves the original hash's values" # Expected nil == 1 to be truthy but was false fails "Hash#to_proc the returned proc raises ArgumentError if not passed exactly one argument" # Expected ArgumentError but no exception was raised (nil was returned) fails "Hash#to_s does not raise if inspected result is not default external encoding" # Mock 'utf_16be' expected to receive inspect("any_args") exactly 1 times but received it 0 times end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/singleton.rb
spec/filters/unsupported/singleton.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Singleton" do fails "Singleton#_dump returns an empty string from a singleton subclass" # NoMethodError: undefined method `_dump' for #<SingletonSpecs::MyClassChild:0x9dc> fails "Singleton#_dump returns an empty string" # NoMethodError: undefined method `_dump' for #<SingletonSpecs::MyClass:0x794> fails "Singleton.allocate is a private method" # Expected NoMethodError but no exception was raised (#<SingletonSpecs::MyClass:0x9b4> was returned) fails "Singleton.new is a private method" # Expected NoMethodError but no exception was raised (#<SingletonSpecs::NewSpec:0xafbfc> was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/filters/unsupported/symbol.rb
spec/filters/unsupported/symbol.rb
# NOTE: run bin/format-filters after changing this file opal_unsupported_filter "Symbol" do fails "A Symbol literal can be an empty string" # Expected "\"\"" == ":\"\"" to be truthy but was false fails "A Symbol literal can be created by the %s-delimited expression" # Expected "\"foo bar\"" == ":\"foo bar\"" to be truthy but was false fails "A Symbol literal can contain null in the string" # Expected "\"\\u0000\"" == ":\"\\x00\"" to be truthy but was false fails "A Symbol literal is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters" # Expected "\"foo bar\"" == ":\"foo bar\"" to be truthy but was false fails "A Symbol literal is a ':' followed by any number of valid characters" # Expected "\"foo\"" == ":foo" to be truthy but was false fails "A Symbol literal is converted to a literal, unquoted representation if the symbol contains only valid characters" # Expected "\"foo\"" == ":foo" to be truthy but was false fails "Marshal.dump with a Symbol dumps a Symbol" # Expected "\x04\b\"\vsymbol" == "\x04\b:\vsymbol" to be truthy but was false fails "Marshal.dump with a Symbol dumps a big Symbol" # Expected "\x04\b\"\x02,\x01bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig" == "\u0004\b:\u0002,\u0001bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig" to be truthy but was false fails "Marshal.dump with a Symbol dumps a binary encoded Symbol" # Expected "\x04\b\"\x06→" == "\x04\b:\bâ\x86\x92" to be truthy but was false fails "Marshal.dump with a Symbol dumps an encoded Symbol" # ArgumentError: unknown encoding name - utf-16 fails "Marshal.dump with an Array dumps a non-empty Array" # Expected "\x04\b[\b\"\x06ai\x06i\a" == "\x04\b[\b:\x06ai\x06i\a" to be truthy but was false fails "Module#const_get raises a NameError if a Symbol has a toplevel scope qualifier" # Expected NameError but no exception was raised ("const1" was returned) fails "Module#const_get raises a NameError if a Symbol is a scoped constant name" # Expected NameError but no exception was raised ("const10_10" was returned) fails "Numeric#coerce raises a TypeError when passed a Symbol" # Expected TypeError but got: ArgumentError (invalid value for Float(): "symbol") fails "The throw keyword does not convert strings to a symbol" # Expected ArgumentError but no exception was raised (nil was returned) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/dependency_resolver_spec.rb
spec/lib/dependency_resolver_spec.rb
require 'lib/spec_helper' RSpec.describe Opal::Nodes::CallNode::DependencyResolver do let(:compiler) { double(:compiler, dynamic_require_severity: :warning) } it "resolves simple strings to themselves" do expect(resolve s(:str, 'foo')).to eq('foo') end context "using a dynamic segment not supported" do it "raises a compiler error when severity is :error" do compiler = double(:compiler, dynamic_require_severity: :error) expect(compiler).to receive(:dynamic_require_severity).once expect(compiler).not_to receive(:warning) expect(compiler).to receive(:error).once described_class.new(compiler, s(:self)).resolve end it "produces a compiler warning when severity is :warning" do compiler = double(:compiler, dynamic_require_severity: :warning) expect(compiler).to receive(:dynamic_require_severity).once expect(compiler).to receive(:warning).once expect(compiler).not_to receive(:error) described_class.new(compiler, s(:self)).resolve end it "does not produce a warning when severity is :ignore" do compiler = double(:compiler, dynamic_require_severity: :ignore) expect(compiler).to receive(:dynamic_require_severity).once expect(compiler).not_to receive(:warning) expect(compiler).not_to receive(:error) described_class.new(compiler, s(:self)).resolve end end def s(type, *children) ::Opal::AST::Node.new(type, children) end def resolve(sexp) described_class.new(compiler, sexp).resolve end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/project_spec.rb
spec/lib/project_spec.rb
require 'lib/spec_helper' RSpec.describe Opal::Project do context "when used by Builder" do let(:builder) do b = Opal::Builder.new b.append_paths(__dir__+"/fixtures/project") b end it "adds a project and adds a load path from Opalfile if a file is built" do b = builder b.build("p1/test") b.build("require_from_p3") b.to_s.should include("require_from_p3_working") end it "adds a project and adds a load path from Opalfile if a path is appended" do b = builder b.append_paths(__dir__+"/fixtures/project/p1") b.build("require_from_p3") b.to_s.should include("require_from_p3_working") end it "adds a project and adds a gem from Opalfile if a path is appended" do b = builder b.append_paths(__dir__+"/fixtures/project/p2") b.build("rake/version") b.to_s.should include("VERSION") end it "adds a project and adds an absolute load path from Opalfile if a path is appended" do b = builder b.append_paths(__dir__+"/fixtures/project/p5") b.build("require_from_p3") b.to_s.should include("require_from_p3_working") end it "raises when Opalfile contains an unknown directive" do b = builder -> do b.append_paths(__dir__+"/fixtures/project/p4") end.should raise_error Opal::OpalfileUnknownDirective end it "doesn't break when adding a non-existent load path" do b = builder -> do b.append_paths(__dir__+"/fixtures/project/non_existent") end.should_not raise_error end context "should include gem paths by default" do %w[racc/info parser/version ast].each do |gem| it "for #{gem.split('/').first}" do b = builder b.build("#{gem}") b.to_s.should include(gem == 'ast' ? "AST" : "VERSION") end end end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/paths_spec.rb
spec/lib/paths_spec.rb
require 'lib/spec_helper' RSpec.describe 'Opal.use_gem' do # Coverage probably should be improved it 'adds require_paths of a gem to Opal paths' do begin Opal.use_gem 'rake' rescue Opal::GemNotFound => e raise(e) unless e.gem_name == 'rake' skip %(Will fail if GEM_HOME has "rake" in the path, that's ok) end added_rake_paths = Opal.paths.grep(/rake/) expect(added_rake_paths.size).to eq(1) expect(added_rake_paths.first).to match(%r{/rake-[\d\.]+/lib$}) end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/deprecations_spec.rb
spec/lib/deprecations_spec.rb
require 'lib/spec_helper' require 'opal/deprecations' RSpec.describe Opal::Deprecations do subject { Object.new.extend described_class } it 'defaults to warn' do expect(subject).to receive(:warn) subject.deprecation "there's a new api!" end it 'can be set to raise' do subject.raise_on_deprecation = true expect(subject).to receive(:raise) subject.deprecation "there's a new api!" end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/repl_spec.rb
spec/lib/repl_spec.rb
require 'lib/spec_helper' require 'opal/repl' RSpec.describe Opal::REPL do describe '#eval_ruby' do let(:input_and_output) { { 'puts 5' => "5\n=> nil\n", 'a = 1' => "=> 1\n", 'a += 1' => "=> 2\n", 'a + 3' => "=> 5\n", 'puts a + 3' => "5\n=> nil\n", '"#{a} + 3"' => "=> \"2 + 3\"\n", 'puts "#{a} + 3"' => "2 + 3\n=> nil\n", } } subject(:repl) { described_class.new } it 'evaluates user inputs' do repl.colorize = false repl.load_opal input_and_output.each do |input, output| expect { repl.eval_ruby(input) }.to output(output).to_stdout end repl.finish end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/cli_spec.rb
spec/lib/cli_spec.rb
require 'lib/spec_helper' require 'opal/cli' require 'opal/cli_options' require 'stringio' require 'tmpdir' RSpec.describe Opal::CLI do let(:file) { File.expand_path('../fixtures/opal_file.rb', __FILE__) } let(:options) { {} } subject(:cli) { described_class.new(options) } context 'with a file' do let(:options) { {argv: [file]} } it 'runs the file' do expect_output_of{ subject.run }.to eq("hi from opal!\n") end context 'with lib_only: true' do let(:options) { super().merge lib_only: true } it 'raises ArgumentError' do expect{subject.run}.to raise_error(ArgumentError) end end end describe ':evals option' do context 'without evals and paths' do it 'uses stdin' do expect(cli.file).to eq($stdin) expect(cli.filename).to eq('-') expect(cli.argv).to eq([]) end context 'with lib_only: true and opal require' do let(:options) { super().merge lib_only: true } it 'does not raise an error' do expect{subject.run}.not_to raise_error end end end context 'with one eval' do let(:options) { {evals: ['puts "hello"']} } it 'executes the code' do expect_output_of{ subject.run }.to eq("hello\n") end context 'with lib_only: true' do let(:options) { super().merge lib_only: true } it 'raises ArgumentError' do expect{subject.run}.to raise_error(ArgumentError) end end end context 'with many evals' do let(:options) { {evals: ['puts "hello"', 'puts "ciao"']} } it 'executes the code' do expect_output_of{ subject.run }.to eq("hello\nciao\n") end end context 'with a file path arg' do let(:options) { {:evals => ['puts "hello"'], argv: [file]} } it 'considers it as part of ARGV' do expect(cli.argv).to eq([file]) expect(cli.file.tap(&:rewind).read).to eq('puts "hello"') expect(cli.filename).to eq('-e') end end end describe ':no_exit option' do context 'when false' do let(:options) { {no_exit: false, runner: :compiler, evals: ['']} } it 'appends a Kernel#exit at the end of the source' do expect_output_of{ subject.run }.to include(".$exit()") end end context 'when true' do let(:options) { {no_exit: true, runner: :compiler, evals: ['']} } it 'appends a Kernel#exit at the end of the source' do expect_output_of{ subject.run }.not_to include(".$exit();") end end end describe ':lib_only option' do context 'when false' do let(:options) { {lib_only: false, runner: :compiler, evals: [''], skip_opal_require: true, no_exit: true} } it 'appends an empty code block at the end of the source' do expect_output_of{ subject.run }.to include("Opal.nil") end end context 'when true' do let(:options) { {lib_only: true, runner: :compiler, no_exit: true} } it 'appends code block at the end of the source' do expect_output_of{ subject.run }.not_to eq("\n") end context 'without any require' do let(:options) { {lib_only: true, runner: :compiler, skip_opal_require: true, no_exit: true} } it 'raises ArgumentError' do expect{subject.run}.to raise_error(ArgumentError) end end end end describe ':requires options' do context 'with an absolute path' do let(:options) { {:requires => [file], :evals => ['']} } it 'requires the file' do expect_output_of{ subject.run }.to eq("hi from opal!\n") end end context 'with a path relative to a load path' do let(:dir) { File.dirname(file) } let(:filename) { File.basename(file) } let(:options) { {:load_paths => [dir], :requires => [filename], :evals => ['']} } it 'requires the file' do expect_output_of{ subject.run }.to eq("hi from opal!\n") end end end describe ':rbrequires options' do context 'when set' do let(:options) { {:rbrequires => ["some_nonexisting_require"], :evals => [''] } } it 'requires the file before compiling' do expect{ subject.run }.to raise_error(LoadError) end end end describe ':gems options' do context 'with a Gem name' do let(:dir) { File.dirname(file) } let(:filename) { File.basename(file) } let(:gem_name) { 'ast' } let(:options) { {:gems => [gem_name], :evals => ['']} } it "adds the gem's lib paths to Opal.path" do builder = cli.create_builder spec = Gem::Specification.find_by_name(gem_name) spec.require_paths.each do |require_path| require_path = File.join(spec.gem_dir, require_path) expect(builder.path_reader.send(:file_finder).paths).to include(require_path) end end end end describe ':stubs options' do context 'with a stubbed file' do let(:dir) { File.dirname(file) } let(:filename) { File.basename(file) } let(:stub_name) { 'an_unparsable_lib' } let(:options) { {:stubs => [stub_name], :evals => ["require #{stub_name.inspect}"]} } it "adds the gem's lib paths to Opal.path" do expect_output_of{ subject.run }.to eq('') end end end describe ':verbose option' do let(:options) { {:verbose => true, :evals => ['']} } it 'sets the verbose flag (currently unused)' do expect(cli.verbose).to eq(true) end end describe ':runner option' do context 'when :compile' do let(:options) { {runner: :compiler, evals: ['puts 2342']} } it 'outputs the compiled javascript' do expect_output_of{ subject.run }.to include(".$puts(2342)") expect_output_of{ subject.run }.not_to include("2342\n") end context 'with the :map_file runner option' do let(:map_file) { "#{Dir.mktmpdir 'opal-map'}/file.map" } let(:runner_options) { { map_file: map_file } } let(:options) { super().merge(runner_options: runner_options) } it 'writes the map file to the specified path' do expect_output_of{ subject.run }.to include(".$puts(2342)") expect_output_of{ subject.run }.not_to include("2342\n") expect(File.read(map_file)).to include(%{"version":3}) end end end # TODO: test more runners end describe ':load_paths options' do let(:dir) { File.dirname(file) } let(:filename) { File.basename(file) } let(:options) { {:load_paths => [dir], :requires => [filename], :evals => ['']} } it 'requires files' do expect_output_of{ subject.run }.to eq("hi from opal!\n") end end describe ':sexp option' do let(:options) { {evals: ['puts 4'], sexp: true} } it 'prints syntax expressions for the given code' do expect_output_of{ subject.run }.to eq("s(:top,\n s(:send, nil, :puts,\n s(:int, 4)))\n") end end describe ':parse_comments option' do let(:code) do <<-CODE # multiline # comment def m end CODE end let(:options) { { parse_comments: true, evals: [code], runner: :compiler } } it 'sets $$comment prop for compiled methods' do expect_output_of { subject.run }.to include('$$comments: ["# multiline", "# comment"]') end end describe ':enable_source_location' do let(:file) { File.expand_path('../fixtures/source_location_test.rb', __FILE__) } let(:options) { { enable_source_location: true, runner: :compiler, argv: [file] } } it 'sets $$source_location prop for compiled methods' do expect_output_of { subject.run }.to include("source_location_test.rb', 6]") end end describe ':debug_source_map' do let(:options) { { debug_source_map: true, evals: ['puts 123'] } } it 'generates a link to https://sokra.github.io/source-map-visualization' do expect_output_of { subject.run }.to start_with( "https://sokra.github.io/source-map-visualization/#base64," ) end end context 'using pipes' do it 'runs the provided source' do # `echo` on windows will output double-quotes along with the contents, that's why we print with ruby expect(`ruby -e"puts 'foo'" | ruby bin/opal -ropal/platform -e "puts gets.reverse"`.strip).to eq("oof") end it 'compiles the provided source' do # `echo` on windows will output double-quotes along with the contents, that's why we print with ruby expect(`ruby -e"puts 'puts 123'" | ruby bin/opal -cEO`.strip).to include("self.$puts(123)") end # TODO: test refreshes with the server runner (only way to ensure we correctly rewind or cache the eval contents) end describe '--dce option' do it 'parses the comma-separated list into symbol types with default' do opts = Opal::CLIOptions.new opts.parse(%w[--dce]) expect(opts.options[:dce]).to eq([:method]) opts = Opal::CLIOptions.new opts.parse(%w[--dce method,const]) expect(opts.options[:dce]).to eq([:method, :const]) end it 'enables fragment caching and passes dce config to the builder' do cli = Opal::CLI.new( dce: [:const], runner: :compiler, evals: ['puts :hi'], no_exit: true, skip_opal_require: true ) builder = cli.send(:create_builder) expect(builder.dce).to eq([:const]) expect(builder.compiler_options[:cache_fragments]).to eq(true) end it 'applies const DCE in compiler output' do fake_output = StringIO.new cli = Opal::CLI.new( dce: [:const], runner: :compiler, evals: ['module M; X = 1; end'], no_exit: true, skip_opal_require: true, output: fake_output ) cli.run fake_output.rewind expect(fake_output.read).to include('Removed by DCE: M') end end private def expect_output_of @output, _result = output_and_result_of { yield } expect(@output) end def output_and_result_of fake_stdout = StringIO.new stdout = described_class.stdout described_class.stdout = fake_stdout result = yield output = fake_stdout.tap(&:rewind).read return output, result ensure described_class.stdout = stdout end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/simple_server_spec.rb
spec/lib/simple_server_spec.rb
require 'lib/spec_helper' require 'rack/test' RSpec.describe Opal::SimpleServer do include Rack::Test::Methods attr_accessor :app # Ensure that each `get` call leads to a new rack session. def get(path) rack_test_session(nil).get(path) end shared_examples "simple server" do before do Opal.append_path "#{__dir__}/fixtures" self.app = described_class.new(main: 'console') end it 'serves opal assets' do response = get "/assets/console.#{ext}#{sub_console}" expect(response.body).to include('self["native"].trace()') end it 'serves index for all non opal paths' do %w[/ /foo /foo/bar/baz].each do |path| response = get path expect(response.body).to include('<html>') expect(response.body).to include('<script') expect(response.body).to include("src=\"/assets/console.#{ext}#{index}\"") expect(response.body).to include('type="module"') if esm? expect(response.body).not_to include('type="module"') unless esm? expect(response.headers['Content-type']).to eq('text/html') end end it 'serves the source map as data uri' do response = get "/assets/console.#{ext}#{sub_console}" if directory? expect(response.body).to include("\n//# sourceMappingURL=./console.map") source_map = get("/assets/console.mjs/opal/#{Opal::VERSION_MAJOR_MINOR}/console.map").body expect(source_map).to include("../../opal/src") expect(source_map).to include("console.rb") else expect(response.body).to include("\n//# sourceMappingURL=data:application/json;base64,") base64_map = response.body.split("\n//# sourceMappingURL=data:application/json;base64,").last expect(Base64.decode64(base64_map)).to eq(Opal::Builder.build('console').source_map.to_json) end end it 'takes a :prefix option to set the assets prefix' do self.app = described_class.new(main: 'opal', prefix: 'foo') expect(get("/foo/console.#{ext}#{sub_console}").body).to include('self["native"].trace()') self.app = described_class.new(main: 'opal', prefix: '/foo') expect(get("/foo/console.#{ext}#{sub_console}").body).to include('self["native"].trace()') end it 'takes a :main option to set the main asset' do self.app = described_class.new(main: 'opal_file') expect(get('/').body).to include("src=\"/assets/opal_file.#{ext}") end it 'respects config set in Opal::Config' do Opal::Config.arity_check_enabled = false self.app = described_class.new(main: 'console') expect(get("/assets/console.#{ext}#{sub_console}").body).not_to include('$$parameters: []') Opal::Config.arity_check_enabled = true self.app = described_class.new(main: 'console') expect(get("/assets/console.#{ext}#{sub_console}").body).to include('$$parameters: []') end it 'supports a custom Builder' do builder = Opal::Builder.new builder.build('console') builder.build_str('1312312313', '(test)') self.app = described_class.new(main: 'console', builder: builder) expect(get("/assets/console.#{ext}#{sub_console}").body).to include('self["native"].trace()') expect(get("/assets/console.#{ext}#{sub_test}").body).to include('1312312313') end it 'supports a custom Builder given as a proc' do pr = ->() do builder = Opal::Builder.new builder.build('console') builder.build_str('1312312313', '(test)') builder end self.app = described_class.new(main: 'console', builder: pr) expect(get("/assets/console.#{ext}#{sub_console}").body).to include('self["native"].trace()') expect(get("/assets/console.#{ext}#{sub_test}").body).to include('1312312313') end end context "in non-directory, non-ESM mode" do before(:each) do Opal::Config.esm = false Opal::Config.directory = false end let(:ext) { "js" } let(:index) { "" } let(:sub_console) { "" } let(:sub_test) { "" } let(:directory?) { false } let(:esm?) { false } include_examples "simple server" end context "in directory, ESM mode" do before(:each) do Opal::Config.esm = true Opal::Config.directory = true end let(:ext) { "mjs" } let(:index) { "/index.mjs" } let(:sub_console) { "/opal/#{Opal::VERSION_MAJOR_MINOR}/console.mjs" } let(:sub_test) { "/opal/#{Opal::VERSION_MAJOR_MINOR}/(test).mjs" } let(:directory?) { true } let(:esm?) { true } include_examples "simple server" end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/builder_processors_spec.rb
spec/lib/builder_processors_spec.rb
require 'lib/spec_helper' require 'opal/builder/processor' RSpec.describe Opal::Builder::Processor::JsProcessor do it 'maps to one fragment per line' do processor = described_class.new("line1\n line2\n line3", 'file.js') expect(processor.source_map.fragments.map(&:code)).to eq([ "line1\n", " line2\n", " line3\n", "Opal.loaded([\"file.js\"]);", ]) end it 'adds loading code at the end of the source' do processor = described_class.new("line1\n line2\n line3", 'file.js') expect(processor.source).to eq(%Q{line1\n line2\n line3\nOpal.loaded(["file.js"]);}) end end RSpec.describe Opal::Builder::Processor::RubyProcessor do it 'compiles ruby to js' do processor = described_class.new('puts 5', '-e') expect(processor.to_s).to include('$puts(5)') end describe ':requirable option' do it 'is respected' do processor = described_class.new('puts 5', '-e', requirable: true) expect(processor.to_s).to include('Opal.modules[') end it 'defaults to "false"' do processor = described_class.new('puts 5', '-e') expect(processor.to_s).not_to include('Opal.modules[') end end it 'fills required_trees' do processor = described_class.new('require_tree "./pippo"', '-e') expect(processor.required_trees).to eq(['./pippo']) end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/builder_spec.rb
spec/lib/builder_spec.rb
require 'lib/spec_helper' require 'opal/os' require 'opal/builder' require 'opal/builder/scheduler/sequential' require 'opal/builder/scheduler/threaded' require 'tmpdir' RSpec.describe Opal::Builder do subject(:builder) { described_class.new(options) } let(:builder_with_paths) { builder.append_paths(File.expand_path('..', __FILE__)); builder } let(:options) { {} } let(:ruby_processor) { Opal::Builder::Processor::RubyProcessor } def temporarily_with_prefork_scheduler(&block) previous = Opal.builder_scheduler Opal.builder_scheduler = Opal::Builder::Scheduler::Prefork yield Opal.builder_scheduler = previous end def temporarily_with_sequential_scheduler(&block) previous = Opal.builder_scheduler Opal.builder_scheduler = Opal::Builder::Scheduler::Sequential yield Opal.builder_scheduler = previous end def temporarily_with_threaded_scheduler(&block) previous = Opal.builder_scheduler Opal.builder_scheduler = Opal::Builder::Scheduler::Threaded yield Opal.builder_scheduler = previous end it 'compiles opal' do expect(builder.build('opal').to_s).to match('(Opal);') end it 'respect #require_tree calls' do expect(builder_with_paths.build('fixtures/require_tree_test').to_s).to include('Opal.modules["fixtures/required_tree_test/required_file1"]') end describe ':stubs' do let(:options) { {stubs: ['foo']} } around(:each) { |example| temporarily_with_sequential_scheduler(&example) } it 'compiles them as empty files' do source = 'require "foo"' expect(ruby_processor).to receive('new').with(source, anything, anything, anything).once.and_call_original expect(ruby_processor).to receive('new').with('', anything, anything, anything).once.and_call_original builder.build_str(source, 'bar.rb') end end describe 'dup' do it 'duplicates internal structures' do b2 = builder.dup b2.should_not equal(builder) [:stubs, :processors, :path_reader, :compiler_options, :processed].each do |m| b2.send(m).should_not equal(builder.send(m)) end end it 'processes dependencies correctly' do b2 = builder 2.times do b2 = b2.dup source = 'require "json"' b2.build_str(source, 'bar.rb') b2.to_s.should include("$to_json") end end end describe 'requiring a native .js file' do it 'can be required without specifying extension' do builder_with_paths.build_str('require "fixtures/required_file"', 'foo') expect(builder_with_paths.to_s).to include("console.log('required file');") end it 'can be required specifying extension' do builder_with_paths.build_str('require "fixtures/required_file.js"', 'foo') expect(builder_with_paths.to_s).to include("console.log('required file');") end end it 'defaults config from Opal::Config' do Opal::Config.arity_check_enabled = false expect(Opal::Config.arity_check_enabled).to eq(false) expect(Opal::Config.compiler_options[:arity_check]).to eq(false) builder = described_class.new builder.build_str('def foo; end', 'foo') expect(builder.to_s).not_to include('$$parameters: []') Opal::Config.arity_check_enabled = true expect(Opal::Config.arity_check_enabled).to eq(true) expect(Opal::Config.compiler_options[:arity_check]).to eq(true) builder = described_class.new builder.build_str('def foo; end', 'foo') expect(builder.to_s).to include('$$parameters: []') end describe '#missing_require_severity' do around(:each) { |example| temporarily_with_sequential_scheduler(&example) } it 'defaults to warning' do expect(builder.missing_require_severity).to eq(:error) end context 'when set to :warning' do let(:options) { {missing_require_severity: :warning} } it 'warns the user' do expect(builder.missing_require_severity).to eq(:warning) expect(builder).to receive(:warn) { |message| expect(message).to start_with(%{Warning: can't find file: "non-existen-file"}) }.at_least(1) builder.build_str("require 'non-existen-file'", 'foo.rb') end end context 'when set to :ignore' do let(:options) { {missing_require_severity: :ignore} } it 'does nothing' do expect(builder.missing_require_severity).to eq(:ignore) expect(builder).not_to receive(:warn) expect{ builder.build_str("require 'non-existen-file'", 'foo.rb') }.not_to raise_error end end context 'when set to :error' do let(:options) { {missing_require_severity: :error} } it 'raises MissingRequire' do expect(builder.missing_require_severity).to eq(:error) expect(builder).not_to receive(:warn) expect{ builder.build_str("require 'non-existen-file'", 'foo.rb') }.to raise_error(described_class::MissingRequire) end end end describe ':requirable' do it 'it uses relative paths as module names' do expect(builder.build('stringio', requirable: true).to_s).to include(%{Opal.modules["stringio"]}) end end describe ':requirable' do it 'it uses front slash as module name' do expect(builder.build('opal/platform', requirable: true).to_s).to include(%{Opal.modules["opal/platform"]}) end end describe 'output order' do it 'is preserved with a prefork scheduler' do skip "Scheduler::Prefork not available for #{RUBY_ENGINE}" if %w[jruby truffleruby].include?(RUBY_ENGINE) skip "Scheduler::Prefork not available on Windows" if Opal::OS.windows? temporarily_with_prefork_scheduler do my_builder = builder_with_paths.dup my_builder.cache = Opal::Cache::NullCache.new 10.times do |i| # Increase entropy expect( my_builder.dup.build('fixtures/build_order').to_s.scan(/(FILE_[0-9]+)/).map(&:first) ).to eq(%w[ FILE_1 FILE_2 FILE_3 FILE_4 FILE_51 FILE_5 FILE_61 FILE_62 FILE_63 FILE_64 FILE_6 FILE_7 ]) end end end it 'is preserved with a sequential scheduler' do temporarily_with_sequential_scheduler do expect( builder_with_paths.build('fixtures/build_order').to_s.scan(/(FILE_[0-9]+)/).map(&:first) ).to eq(%w[ FILE_1 FILE_2 FILE_3 FILE_4 FILE_51 FILE_5 FILE_61 FILE_62 FILE_63 FILE_64 FILE_6 FILE_7 ]) end end it 'is preserved with a threaded scheduler' do skip 'Scheduler::Threaded is only available for JRuby, TruffleRuby' unless %w[jruby truffleruby].include?(RUBY_ENGINE) temporarily_with_threaded_scheduler do expect( builder_with_paths.build('fixtures/build_order').to_s.scan(/(FILE_[0-9]+)/).map(&:first) ).to eq(%w[ FILE_1 FILE_2 FILE_3 FILE_4 FILE_51 FILE_5 FILE_61 FILE_62 FILE_63 FILE_64 FILE_6 FILE_7 ]) end end end describe 'directory mode' do shared_examples 'directory mode' do let(:options) { {compiler_options: {directory: true, esm: esm?}}} let(:ver) { Opal::VERSION_MAJOR_MINOR } it 'builds a correct directory structure' do Dir.mktmpdir("opal-test-") do |dir| builder.build('console') builder.compile_to_directory(dir+"/UniqueString/") files = Dir["#{dir}/**/*"].map { |i| i.split("/UniqueString/")[1] }.compact expected_files = %W[index.#{ext} opal opal/#{ver} opal/#{ver}/console.#{ext} opal/#{ver}/console.map opal/#{ver}/native.#{ext} opal/#{ver}/native.map opal/src opal/src/console.rb opal/src/native.rb] expected_files << 'index.html' if esm? expect(files.sort).to eq(expected_files.sort) end end it 'builds a single file if requested' do builder.build('console') file = builder.compile_to_directory(single_file: "opal/src/console.rb") expect(file).to eq(File.binread("#{__dir__}/../../stdlib/console.rb")) end end context 'with ESM enabled' do let(:esm?) { true } let(:ext) { "mjs" } include_examples 'directory mode' end context 'with ESM disabled' do let(:esm?) { false } let(:ext) { "js" } include_examples 'directory mode' end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/cli_runners_spec.rb
spec/lib/cli_runners_spec.rb
require 'lib/spec_helper' require 'opal/cli_runners' RSpec.describe Opal::CliRunners do around do |example| original_register = described_class.instance_variable_get :@register example.run described_class.instance_variable_set :@register, original_register end describe '.alias_runner' do it 'aliases between runner names' do expect(described_class[:node]).to eq(described_class[:nodejs]) end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/path_reader_spec.rb
spec/lib/path_reader_spec.rb
require 'lib/spec_helper' require 'opal/path_reader' RSpec.describe Opal::PathReader do subject(:path_reader) { described_class.new } let(:path) { 'opal_file' } let(:full_path) { File.expand_path('../fixtures/opal_file.rb', __FILE__) } let(:contents) { File.read(full_path, mode: "rb:UTF-8") } before do allow_any_instance_of(Opal::Hike::Trail).to receive(:find) {|path| nil} allow_any_instance_of(Opal::Hike::Trail).to receive(:find).with(path).and_return(full_path) end describe '#paths' do it 'is an Enumberable' do expect(path_reader.paths).to be_an(Enumerable) end it 'includes Opal.paths' do paths = path_reader.paths.to_a Opal.paths.each { |path| expect(paths).to include(path) } end end describe '#read' do it 'reads the contents from the path' do expect(path_reader.read(path)).to eq(contents) end it 'returns nil if the file is missing' do expect(path_reader.read('unexpected-path!')).to be_nil end end it 'works with absolute paths' do expect(path_reader.read(File.expand_path(__FILE__))).not_to be_nil end it 'works with relative paths starting with ./' do expect(path_reader.read('./spec/lib/spec_helper.rb')).not_to be_nil end it 'works with absolute paths' do expect(path_reader.read("../#{File.basename(Dir.pwd)}/spec/lib/spec_helper.rb")).not_to be_nil end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rake_dist_spec.rb
spec/lib/rake_dist_spec.rb
require 'lib/spec_helper' require 'open3' require 'opal/os' RSpec.describe "rake dist" do before :all do system "rake dist >#{Opal::OS.dev_null}" end def run_with_node(code, precode:, requires:) requires = requires.map do |i| "require('./build/#{i}');" end.join code = "#{requires};#{precode};console.log(#{code});" stdout, _, status = Open3.capture3('node', '-e', code) expect(status.exitstatus).to eq(0) stdout.chomp end let(:output) { run_with_node(code, precode: precode, requires: requires) } let(:requires) { ['opal'] } let(:precode) { '' } let(:code) { 'typeof Opal' } it 'should provide a working Opal environment' do expect(output).to eq('object') end context do let(:requires) { ['opal/mini'] } it 'should provide a working Opal mini environment' do expect(output).to eq('object') end end context do let(:requires) { ['opal', 'opal/full'] } let(:precode) { 'Opal.require("corelib/pattern_matching")' } let(:code) { 'typeof Opal.PatternMatching' } it 'should provide a working Opal full environment' do expect(output).to eq('function') end end context do let(:requires) { %w[opal opal-replutils] } let(:code) { 'typeof Opal.REPLUtils' } it 'should not require requirable files by default' do expect(output).to eq('undefined') end end context do let(:requires) { %w[opal opal-replutils] } let(:precode) { 'Opal.require("opal-replutils")' } let(:code) { 'typeof Opal.REPLUtils' } it 'should allow user to require requirable files to provide missing functionality' do expect(output).to eq('function') end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/config_spec.rb
spec/lib/config_spec.rb
require 'lib/spec_helper' require 'opal/config' RSpec.describe Opal::Config do before { described_class.reset! } after { described_class.reset! } describe '.default_config' do it 'is new each time' do default_config1 = described_class.default_config default_config2 = described_class.default_config expect(default_config1).to eq(default_config2) expect(default_config1).not_to equal(default_config2) described_class.default_config[:stubbed_files] << :foo expect(described_class.default_config[:stubbed_files]).to eq(Set.new) end end it 'has expected default values' do expect(described_class.method_missing_enabled).to eq(true) expect(described_class.const_missing_enabled).to eq(true) expect(described_class.arity_check_enabled).to eq(false) expect(described_class.freezing_stubs_enabled).to eq(true) expect(described_class.dynamic_require_severity).to eq(:warning) expect(described_class.missing_require_severity).to eq(:error) expect(described_class.irb_enabled).to eq(false) expect(described_class.inline_operators_enabled).to eq(true) expect(described_class.source_map_enabled).to eq(true) expect(described_class.stubbed_files).to eq(Set.new) end it 'raises an ArgumentError if provided with an unexpected value' do expect{ described_class.method_missing_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.const_missing_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.arity_check_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.freezing_stubs_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.dynamic_require_severity = :foobar }.to raise_error(ArgumentError) expect{ described_class.missing_require_severity = :foobar }.to raise_error(ArgumentError) expect{ described_class.irb_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.inline_operators_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.source_map_enabled = :foobar }.to raise_error(ArgumentError) expect{ described_class.stubbed_files = :foobar }.to raise_error(ArgumentError) end it 'does not raises errors if provided with an expected value' do expect{ described_class.arity_check_enabled = false }.not_to raise_error expect(described_class.arity_check_enabled).to eq(false) expect{ described_class.arity_check_enabled = true }.not_to raise_error expect(described_class.arity_check_enabled).to eq(true) expect{ described_class.const_missing_enabled = false }.not_to raise_error expect(described_class.const_missing_enabled).to eq(false) expect{ described_class.const_missing_enabled = true }.not_to raise_error expect(described_class.const_missing_enabled).to eq(true) expect{ described_class.dynamic_require_severity = :error }.not_to raise_error expect(described_class.dynamic_require_severity).to eq(:error) expect{ described_class.dynamic_require_severity = :ignore }.not_to raise_error expect(described_class.dynamic_require_severity).to eq(:ignore) expect{ described_class.dynamic_require_severity = :warning }.not_to raise_error expect(described_class.dynamic_require_severity).to eq(:warning) expect{ described_class.missing_require_severity = :error }.not_to raise_error expect(described_class.missing_require_severity).to eq(:error) expect{ described_class.missing_require_severity = :ignore }.not_to raise_error expect(described_class.missing_require_severity).to eq(:ignore) expect{ described_class.missing_require_severity = :warning }.not_to raise_error expect(described_class.missing_require_severity).to eq(:warning) expect{ described_class.freezing_stubs_enabled = false }.not_to raise_error expect(described_class.freezing_stubs_enabled).to eq(false) expect{ described_class.freezing_stubs_enabled = true }.not_to raise_error expect(described_class.freezing_stubs_enabled).to eq(true) expect{ described_class.inline_operators_enabled = false }.not_to raise_error expect(described_class.inline_operators_enabled).to eq(false) expect{ described_class.inline_operators_enabled = true }.not_to raise_error expect(described_class.inline_operators_enabled).to eq(true) expect{ described_class.irb_enabled = false }.not_to raise_error expect(described_class.irb_enabled).to eq(false) expect{ described_class.irb_enabled = true }.not_to raise_error expect(described_class.irb_enabled).to eq(true) expect{ described_class.method_missing_enabled = false }.not_to raise_error expect(described_class.method_missing_enabled).to eq(false) expect{ described_class.method_missing_enabled = true }.not_to raise_error expect(described_class.method_missing_enabled).to eq(true) expect{ described_class.source_map_enabled = false }.not_to raise_error expect(described_class.source_map_enabled).to eq(false) expect{ described_class.source_map_enabled = true }.not_to raise_error expect(described_class.source_map_enabled).to eq(true) expect{ described_class.stubbed_files << 'foo' }.not_to raise_error expect(described_class.stubbed_files).to eq(['foo'].to_set) expect{ described_class.stubbed_files = %w[foo bar].to_set }.not_to raise_error expect(described_class.stubbed_files).to eq(%w[foo bar].to_set) end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/spec_helper.rb
spec/lib/spec_helper.rb
$VERBOSE = true if ENV['CHECK_COVERAGE'] require 'coveralls' Coveralls.wear! end if ENV['CHECK_COVERAGE_SIMPLECOV'] require 'simplecov' SimpleCov.start end require 'opal' ENV['OPAL_DISABLE_PREFORK_LOGS'] = '1' $diagnostic_messages = [] Opal::Parser.default_parser_class.diagnostics_consumer = ->(diagnostic) do $diagnostic_messages << diagnostic.render end # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| config.before { Opal.reset_paths! unless RUBY_PLATFORM == 'opal' } config.before { Opal::Config.reset! if defined? Opal::Config } config.before { Opal::Processor.reset_cache_key! if defined? Opal::Processor } config.before { $diagnostic_messages.clear } # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. config.expect_with :rspec do |expectations| # This option will default to `true` in RSpec 4. It makes the `description` # and `failure_message` of custom matchers include text for helper methods # defined using `chain`, e.g.: # be_bigger_than(2).and_smaller_than(4).description # # => "be bigger than 2 and smaller than 4" # ...rather than: # # => "be bigger than 2" expectations.include_chain_clauses_in_custom_matcher_descriptions = true expectations.syntax = [:expect, :should] end # rspec-mocks config goes here. You can use an alternate test double # library (such as bogus or mocha) by changing the `mock_with` option here. config.mock_with :rspec do |mocks| # Prevents you from mocking or stubbing a method that does not exist on # a real object. This is generally recommended, and will default to # `true` in RSpec 4. mocks.verify_partial_doubles = true mocks.syntax = [:expect, :should] end # This option will default to `:apply_to_host_groups` in RSpec 4 (and will # have no way to turn it off -- the option exists only for backwards # compatibility in RSpec 3). It causes shared context metadata to be # inherited by the metadata hash of host groups and examples, rather than # triggering implicit auto-inclusion in groups with matching metadata. config.shared_context_metadata_behavior = :apply_to_host_groups if config.respond_to? :shared_context_metadata_behavior # This allows you to limit a spec run to individual examples or groups # you care about by tagging them with `:focus` metadata. When nothing # is tagged with `:focus`, all examples get run. RSpec also provides # aliases for `it`, `||\describe`, and `context` that include `:focus` # metadata: `fit`, `fdescribe` and `fcontext`, respectively. config.filter_run_when_matching :focus if config.respond_to? :filter_run_when_matching # Allows RSpec to persist some state between runs in order to support # the `--only-failures` and `--next-failure` CLI options. We recommend # you configure your source control system to ignore this file. config.example_status_persistence_file_path = "tmp/examples.txt" if config.respond_to? :example_status_persistence_file_path # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode # config.disable_monkey_patching! # This setting enables warnings. It's recommended, but in some cases may # be too noisy due to issues in dependencies. # config.warnings = true # Many RSpec users commonly either run the entire suite or an individual # file, and it's useful to allow more verbose output when running an # individual spec file. if config.files_to_run.one? # Use the documentation formatter for detailed output, # unless a formatter has already been configured # (e.g. via a command-line flag). config.default_formatter = 'doc' # Show full backtrace config.backtrace_exclusion_patterns = [] else # The RSpec specs are stored in spec/lib. config.pattern = 'spec/lib/**/*_spec.rb' end # Print the 10 slowest examples and example groups at the # end of the spec run, to help surface which specs are running # particularly slow. config.profile_examples = 10 # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = :random # Seed global randomization in this process using the `--seed` CLI option. # Setting this allows you to use `--seed` to deterministically reproduce # test failures related to randomization by passing the same `--seed` value # as the one that triggered the failure. Kernel.srand config.seed end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/compiler_spec.rb
spec/lib/compiler_spec.rb
require 'lib/spec_helper' require 'support/match_helpers' RSpec.describe Opal::Compiler do describe 'regexp' do it 'should escape regexp' do expect_compiled("%r{^/{4,}$}").to include('/^\/{4,}$/') expect_compiled('/\\\\"/').to include('/\\\\"/') end end describe 'requiring' do it 'calls #require' do expect_compiled("require 'pippo'").to include('self.$require("pippo")') end end describe 'requirable' do it 'executes the file' do expect_compiled("true").to include('(function(Opal) {') expect_compiled("true").to start_with('Opal.queue(function(Opal) {') expect_compiled("true").to end_with("});\n") end it 'puts the compiled into "Opal.modules"' do options = { :requirable => true, :file => "pippo" } expect_compiled("true", options).to include('Opal.modules["pippo"] = function(Opal) {') expect_compiled("true", options).to end_with("};\n") end end it "should compile simple ruby values" do expect_compiled("3.142").to include("return 3.142") expect_compiled("123e1").to include("return 1230") expect_compiled("123E+10").to include("return 1230000000000") expect_compiled("false").to include("return false") expect_compiled("true").to include("return true") expect_compiled("0;nil").to include("return nil") # NB: Empty nil return is compiled-out end it "should compile ruby strings" do expect_compiled('"hello world"').to include('return "hello world"') expect_compiled('"hello #{100}"').to include('"hello "', '100') end it "should compile ruby strings with escapes" do expect_compiled('"hello \e"').to include('\u001b') expect_compiled('"hello \e#{nil}"').to include('\u001b') end it "should compile ruby ranges" do expect_compiled('1..1').to include('$range(1, 1, false)') expect_compiled('1...1').to include('$range(1, 1, true)') expect_compiled('..1').to include('$range(nil, 1, false)') expect_compiled('...1').to include('$range(nil, 1, true)') expect_compiled('1..').to include('$range(1, nil, false)') expect_compiled('1...').to include('$range(1, nil, true)') # Following return Opal.range.$new instead of $range. Some also miss a space. expect_compiled('nil..1').to include('(nil, 1, false)') expect_compiled('nil...1').to include('(nil,1, true)') expect_compiled('"a"..nil').to include('("a", nil, false)') expect_compiled('"a"...nil').to include('("a",nil, true)') expect_compiled('..nil').to include('(nil, nil, false)') expect_compiled('...nil').to include('(nil,nil, true)') end it "should compile method calls" do expect_compiled("self.inspect").to include("$inspect()") expect_compiled("self.map { |a| a + 10 }").to include("'map'") end it "adds method missing stubs" do expect_compiled("self.puts 'hello'").to include("Opal.add_stubs('puts')") end it 'adds method missing stubs with operators' do expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs('>,new')") end it "should compile constant lookups" do expect_compiled("Object").to include("Object") expect_compiled("Array").to include("Array") end it "should compile undef calls" do expect_compiled("undef a").to include("$udef(self, '$' + \"a\")") expect_compiled("undef a,b").to match(/\$udef\(self, '\$' \+ "a"\);.*\$udef\(self, '\$' \+ "b"\);/m) end describe "method names" do it "generates a named function for method" do expect_compiled("def test_method; []; end").to include("function $$test_method()") end context "when function name is reserved" do it "generates a valid named function for method" do expect_compiled("def Array; []; end").to include("function $$Array()") end end context "when function name is not valid" do it "generates a name in a safe way" do expect_compiled("def test_method?; []; end").to include("function $test_method$ques$1()") end end end describe "debugger special method" do it "generates debugger keyword in javascript" do expect_compiled("debugger").to include("debugger") expect_compiled("debugger").to_not include("$debugger") end end describe "extracting __END__ content" do shared_examples "it extracts __END__" do |source, expected_eof_content| it "extracts #{expected_eof_content.inspect} from #{source.inspect}" do compiler = Opal::Compiler.new(source) compiler.parse expect(compiler.eof_content).to eq(expected_eof_content) end end include_examples "it extracts __END__", "code", nil include_examples "it extracts __END__", "code\n__END_", nil include_examples "it extracts __END__", "code\n__END__", "" include_examples "it extracts __END__", "code\n\n\n__END__", "" include_examples "it extracts __END__", "code\n__END__data", nil include_examples "it extracts __END__", "code\n__END__\ndata", "data" include_examples "it extracts __END__", "code\n__END__\nline1\nline2", "line1\nline2" include_examples "it extracts __END__", "code\n__END__\nline1\nline2\n", "line1\nline2\n" include_examples "it extracts __END__", "code\n__END__\nline1\nline2\n", "line1\nline2\n" include_examples "it extracts __END__", "code\n __END__\ndata", nil include_examples "it extracts __END__", "\"multiline string\n__END__\nwith data separator\"\n__END__\ndata", "data" end describe "DATA special variable" do it "is not a special case unless __END__ part present in source" do expect_compiled("DATA").to include("DATA") expect_compiled("DATA\nMALFORMED__END__").to include("DATA") expect_compiled("DATA\n__END__").to_not include("DATA") end it "DATA gets compiled as a reference to special $__END__ variable" do expect_compiled("a = DATA\n__END__").to include("a = $__END__") end it "causes the compiler to create a reference to special __END__ variable" do expect_compiled("DATA\n__END__\nFord Perfect").to include("$__END__ = ") end it "does not create a reference to __END__ vairbale unless __END__ content present" do expect_compiled("DATA").to_not include("$__END__ = ") end end describe 'pre-processing require-ish methods' do describe '#require' do it 'parses and resolve #require argument' do compiler = compiler_for(%Q{require "#{__FILE__}"}) expect(compiler.requires).to eq([__FILE__]) end end describe '#autoload' do it 'parses and resolve second #autoload arguments in top scope' do compiler = compiler_for(%Q{autoload :Whatever, "#{__FILE__}"}) expect(compiler.requires).to eq([__FILE__]) end it 'parses and resolve second #autoload arguments' do compiler = compiler_for(%Q{class Foo; autoload :Whatever, "#{__FILE__}"; end}) expect(compiler.requires).to eq([__FILE__]) end end describe '#require_relative' do it 'parses and resolve #require_relative argument' do compiler = compiler_for(%Q{require_relative "./#{File.basename(__FILE__)}"}, file: __FILE__) expect(compiler.requires).to eq([__FILE__]) end end describe '#require_tree' do require 'pathname' it 'parses and resolve #require argument' do file = Pathname(__FILE__).join('../fixtures/require_tree_test.rb') compiler = compiler_for(file.read) expect(compiler.required_trees).to eq(['../fixtures/required_tree_test']) end end end describe 'truthy check' do context 'no parentheses' do context 'with operators' do it 'excludes nil check for primitives' do expect_compiled('foo = 42 if 2 > 3').to include('if ($rb_gt(2, 3))') expect_compiled('foo = 42 if 2.5 > 3.5').to include('if ($rb_gt(2.5, 3.5))') expect_compiled('foo = 42 if true > false').to include('if ($rb_gt(true, false))') end it 'adds nil check for strings' do expect_compiled('foo = 42 if "test" > "bar"').to include('if ($truthy($rb_gt("test", "bar")))') end it 'adds nil check for lvars' do expect_compiled("bar = 4\nfoo = 42 if bar > 5").to include('if ($truthy($rb_gt(bar, 5)))') end it 'adds nil check for constants' do expect_compiled("foo = 42 if Test > 4").to include("if ($truthy($rb_gt($$('Test'), 4))) ") end it 'adds nil check for self' do expect_compiled("foo = 42 if self > 4").to include("if ($truthy($rb_gt(self, 4))) ") end it 'converts each == call inside if to an $eqeq wrapper, which does a truthy check' do expect_compiled('foo = 42 if 2 == 3').to include("if ($eqeq(2, 3))") expect_compiled('foo = 42 if 2.5 == 3.5').to include("if ($eqeq(2.5, 3.5))") expect_compiled('foo = 42 if true == false').to include("if ($eqeq(true, false))") expect_compiled('foo = 42 if "test" == "bar"').to include("if ($eqeq(\"test\", \"bar\"))") expect_compiled("bar = 4\nfoo = 42 if bar == 5").to include("if ($eqeq(bar, 5))") expect_compiled("foo = 42 if Test == 4").to include("if ($eqeq($$('Test'), 4))") expect_compiled("bar = 4\nfoo = 42 if bar == 5").to include("if ($eqeq(bar, 5))") end it "doesn't convert ==/=== calls to $eqeq(eq) wrappers outside of an if" do expect_compiled("bar == 5").not_to include("$eqeq(bar, 5)") end it 'converts each === call inside if to an $eqeqeq wrapper, which does a truthy check' do expect_compiled('foo = 42 if 2 === 3').to include("if ($eqeqeq(2, 3))") expect_compiled('foo = 42 if 2.5 === 3.5').to include("if ($eqeqeq(2.5, 3.5))") expect_compiled('foo = 42 if true === false').to include("if ($eqeqeq(true, false))") expect_compiled('foo = 42 if "test" === "bar"').to include("if ($eqeqeq(\"test\", \"bar\"))") expect_compiled("bar = 4\nfoo = 42 if bar === 5").to include("if ($eqeqeq(bar, 5))") expect_compiled("foo = 42 if Test === 4").to include("if ($eqeqeq($$('Test'), 4))") expect_compiled("bar = 4\nfoo = 42 if bar === 5").to include("if ($eqeqeq(bar, 5))") end end context 'without operators' do it 'adds nil check for primitives' do expect_compiled('foo = 42 if 2').to include('if ($truthy(2))') expect_compiled('foo = 42 if 2.5').to include('if ($truthy(2.5))') expect_compiled('foo = 42 if true').to include('if ($truthy(true))') end it 'adds nil check for boolean method calls' do expect_compiled('foo = 42 if true.something').to include('if ($truthy(true.$something()))') end it 'adds nil check for strings' do expect_compiled('foo = 42 if "test"').to include('if ($truthy("test"))') end it 'adds nil check for lvars' do expect_compiled("bar = 4\nfoo = 42 if bar").to include('if ($truthy(bar))') end it 'adds nil check for constants' do expect_compiled("foo = 42 if Test").to include("if ($truthy($$('Test')))") end end end context 'parentheses' do context 'with operators' do it 'adds nil check for strings' do expect_compiled('foo = 42 if ("test" > "bar")').to include('if ($truthy($rb_gt("test", "bar"))') end it 'adds nil check for lvars' do expect_compiled("bar = 4\nfoo = 42 if (bar > 5)").to include('if ($truthy($rb_gt(bar, 5))') end it 'converts == expressions to $eqeq checks' do expect_compiled('foo = 42 if (2 == 3)').to include("if ($eqeq(2, 3))") expect_compiled('foo = 42 if (2.5 == 3.5)').to include("if ($eqeq(2.5, 3.5))") expect_compiled('foo = 42 if (true == false)').to include("if ($eqeq(true, false))") expect_compiled('foo = 42 if ("test" == "bar")').to include("if ($eqeq(\"test\", \"bar\")") expect_compiled("bar = 4\nfoo = 42 if (bar == 5)").to include("if ($eqeq(bar, 5))") expect_compiled("foo = 42 if (Test == 4)").to include("if ($eqeq($$('Test'), 4))") end end context 'without operators' do it 'adds nil check for primitives' do expect_compiled('foo = 42 if (2)').to include('if ($truthy(2)') expect_compiled('foo = 42 if (2.5)').to include('if ($truthy(2.5)') expect_compiled('foo = 42 if (true)').to include('if ($truthy(true)') end it 'adds nil check for boolean method calls' do expect_compiled('foo = 42 if (true.something)').to include('if ($truthy(true.$something())') end it 'adds nil check for strings' do expect_compiled('foo = 42 if ("test")').to include('if ($truthy("test")') end it 'adds nil check for lvars' do expect_compiled("bar = 4\nfoo = 42 if (bar)").to include('if ($truthy(bar)') end it 'adds nil check for constants' do expect_compiled("foo = 42 if (Test)").to include("if ($truthy($$('Test'))") end end end end describe 'Regexp flags' do it 'skips the unsupported ones' do expect_compiled("/foobar/nix").to include("/foobar/i") end end describe 'x-strings' do let(:compiler_options) { {backtick_javascript: true} } describe "escapes" do it "compiles the exscapes directly as appearing in x-strings" do expect_compiled('`"hello\nworld"`').to include('"hello\nworld"') expect_compiled('%x{"hello\nworld"}').to include('"hello\nworld"') end end describe 'semicolons handling' do def compiling(code, &block) compiler = Opal::Compiler.new(code) yield compiler end it "respects JS returns not doubling the trailing semicolon" do expect_compiled(%q{ def foo `return bar(baz)` end }).to include(" return bar(baz);\n") expect_compiled(%q{ def foo %x{return bar(baz)} end }).to include(" return bar(baz);\n") expect_compiled(%q{ def foo %x{return bar(baz);} end }).to include(" return bar(baz);\n") expect_compiled(%q{ def foo %x{ return bar(baz) } end }).to include(" return bar(baz);\n") expect_compiled(%q{ def foo %x{ return bar(baz); } end }).to include(" return bar(baz);\n") expect_compiled(%q{ def foo 789 `#{123 + bar} * 456;` end }).to include(" return $rb_plus(123, self.$bar()) * 456;\n") expect_compiled(%q{ def foo 789 `#$bar * 456` end }).to include(" return $gvars.bar * 456;\n") expect_compiled(%q{ def foo 789 `#@bar * 456` end }).to include(" return self.bar * 456;\n") expect_compiled(%q{ def foo 789 `456 * #@bar` end }).to include(" return 456 * self.bar;\n") expect_compiled(%q{ if `compare === nil` raise ArgumentError, "comparison of #{a.class} with #{b.class} failed" end }).to include(" if ($truthy(compare === nil)) {\n") expect_compiled(%q{ def <<(count) count = Opal.coerce_to! count, Integer, :to_int `#{count} > 0 ? self << #{count} : self >> -#{count}` end }).to include(" return count > 0 ? self << count : self >> -count;\n") expect_compiled(%q{ def self.exist? path path = path.path if path.respond_to? :path `return executeIOAction(function(){return __fs__.existsSync(#{path})})` end }).to include(" return executeIOAction(function(){return __fs__.existsSync(path)});\n") expect_compiled(%q{ def self.exist? path path = path.path if path.respond_to? :path `executeIOAction(function(){return __fs__.existsSync(#{path})})` end }).to include(" return executeIOAction(function(){return __fs__.existsSync(path)});\n") expect_compiled(%q{ def self.exist? path path = path.path if path.respond_to? :path `return executeIOAction(function(){return __fs__.existsSync(#{path})});` end }).to include(" return executeIOAction(function(){return __fs__.existsSync(path)});\n") expect_compiled(%q{ def self.exist? path path = path.path if path.respond_to? :path `executeIOAction(function(){return __fs__.existsSync(#{path})});` end }).to include(" return executeIOAction(function(){return __fs__.existsSync(path)});\n") end it 'warns if a semicolon is used in a single line' do expect_number_of_warnings(%{a = `1;`}).to eq(1) expect_number_of_warnings(%{a = `1;`; return}).to eq(1) expect_number_of_warnings(%{a = `1;`}).to eq(1) expect_number_of_warnings(%{a = ` 1; `}).to eq(1) expect_number_of_warnings(%{a = %x{\n 1; \n}}).to eq(1) expect_number_of_warnings(%{def foo; ` 1; `; end}).to eq(1) end it 'does not warn for statements' do expect_number_of_warnings(%{`foo;`; return}).to eq(0) expect_number_of_warnings(%{`foo;`; 123}).to eq(0) end it 'does not warn for multiline x-strings' do expect_number_of_warnings(%{a = `1;\n2;`}).to eq(0) expect_number_of_warnings(%{a = `1;\n2;3; `}).to eq(0) expect_number_of_warnings(%{def foo;` 1;\n `;end}).to eq(1) end end specify 'when empty' do expect_compiled(%q{ %x{ } }).to include("return nil\n") expect_compiled(%q{ %x{} }).to include("return nil\n") expect_compiled(%q{ ` ` }).to include("return nil\n") expect_compiled(%q{ `` }).to include("return nil\n") end def expect_number_of_warnings(code, options = compiler_options) options = options.merge(eval: true) warnings_number = 0 compiler = Opal::Compiler.new(code, options) allow(compiler).to receive(:warning) { warnings_number += 1 } compiler.compile expect(warnings_number) end end describe '#magic_comments' do def expect_magic_comments_for(*lines) expect(compiler_for(lines.join("\n")).magic_comments) end it 'extracts them in a hash' do expect_magic_comments_for("").to eq({}) expect_magic_comments_for( "", "# foo:true", "", "", "", "#bar : false", "#baz :qux", "#biz :boz", "baz", ).to eq( foo: true, bar: false, baz: "qux", biz: "boz" ) expect_magic_comments_for( "#baz :qux", "#biz :boz", "", "baz", ).to eq( baz: "qux", biz: "boz" ) expect_magic_comments_for( "#-*- baz :qux-*-", "# -*-biz :boz -*- ", ).to eq( baz: "qux", biz: "boz" ) end it 'accepts complex values' do expect_magic_comments_for("").to eq({}) expect_magic_comments_for( "#baz: qux,naz!", "#biz : boz? ,bux, []=", "#buz :<<,+,!@", ).to eq( baz: "qux,naz!", biz: "boz? ,bux, []=", buz: "<<,+,!@", ) end end describe 'magic encoding comment' do let(:diagnostics) { [] } around(:each) do |e| original_diagnostics_consumer = Opal::Parser.default_parser_class.diagnostics_consumer Opal::Parser.default_parser_class.diagnostics_consumer = ->(diagnostic) { diagnostics << diagnostic } e.run Opal::Parser.default_parser_class.diagnostics_consumer = original_diagnostics_consumer end let(:encoding_comment) { '' } let(:string) { '' } let(:file) do <<-RUBY # encoding: #{encoding_comment} "#{string}" RUBY end shared_examples 'it compiles the string as' do |expected| it "compiles the string as #{expected}" do expect_compiled(file).to include(expected) end end shared_examples 'it re-encodes the string using $force_encoding' do it 'it re-encodes the string using $force_encoding' do expect_compiled(file).to include("$force_encoding") end end shared_examples 'it does not re-encode the string using $force_encoding' do it 'it does not re-encode the string using $force_encoding' do expect_compiled(file).to_not include("$force_encoding") end end shared_examples 'it does not print any warnings' do it 'does not print any warnings' do compile(file) expect(diagnostics).to eq([]) end end context 'utf-8 comment' do let(:encoding_comment) { 'utf-8' } context 'valid sequence' do let(:string) { 'λ' } include_examples 'it compiles the string as', 'λ'.inspect include_examples 'it does not re-encode the string using $force_encoding' include_examples 'it does not print any warnings' end context 'invalid sequence' do let(:string) { "\xFF" } it 'raises an error' do expect { compiled(file) }.to raise_error(EncodingError, 'invalid byte sequence in UTF-8') end end end context 'ascii-8bit comment' do let(:encoding_comment) { 'ascii-8bit' } context 'valid sequence' do let(:string) { "\xFF" } include_examples 'it compiles the string as', '$str("\xFF","ASCII-8BIT")' include_examples 'it does not print any warnings' end context 'unicode sequence' do let(:string) { 'λ' } encoded_string = 'λ'.force_encoding("ascii-8bit") include_examples 'it compiles the string as', "$str(#{encoded_string.inspect},\"ASCII-8BIT\")" include_examples 'it does not print any warnings' end end end describe 'a compilation error' do context 'at compile time' do it 'adds the file and line to the backtrace' do error = nil begin compiled('BEGIN {}', file: "#{File.basename(__FILE__)}/foobar.js.rb") rescue Opal::SyntaxError => syntax_error error = syntax_error end expect(error.backtrace[0]).to eq("#{File.basename(__FILE__)}/foobar.js.rb:in `BEGIN {}'") expect(compiler_backtrace(error)[0]).to match(/:in [`'](?:Opal::Compiler#)?error[`']$/) expect(compiler_backtrace(error)[-4]).to match(/:in [`']block in (?:Opal::Compiler#)?fragments[`']$/) expect(compiler_backtrace(error)[-1]).to match(/:in [`'](?:Opal::Compiler#)?compile[`']$/) expect(error.backtrace.size).to be > 1 end end context 'at parse time' do it 'adds the file and line to the backtrace' do error = nil begin parsed('def foo', file: "#{File.basename(__FILE__)}/foobar.js.rb") rescue Opal::SyntaxError => syntax_error error = syntax_error end expect(error.backtrace[0]).to eq("#{File.basename(__FILE__)}/foobar.js.rb:1:in `def foo'") expect(compiler_backtrace(error)[0]).to match(/:in [`']block in (?:Opal::Compiler#)?parse[`']$/) expect(error.backtrace.size).to be > 1 expect($diagnostic_messages.flatten).to eq([ "#{File.basename(__FILE__)}/foobar.js.rb:1:8: error: unexpected token $end", "#{File.basename(__FILE__)}/foobar.js.rb:1: def foo", "#{File.basename(__FILE__)}/foobar.js.rb:1: ", ]) end end def compiler_backtrace(error) error.backtrace.grep(%r{lib/opal/compiler\.rb}) end end describe '[regressions]' do it 'accepts empty rescue within while loop' do # found running bm_vm1_rescue.rb # was raising: NoMethodError: undefined method `type' for nil:NilClass expect{ compiled <<-RUBY while foo begin rescue end end RUBY }.not_to raise_error end it 'accepts a comment as the sole body of a for loop' do expect{ compiled <<-RUBY for foo in bar # end RUBY }.not_to raise_error end end def compiler_options {} end def compiled(code, options = compiler_options) compiler = Opal::Compiler.new(code, options) @compiler_warnings = [] allow(compiler).to receive(:warning) { |*args| @compiler_warnings << args } compiler.compile end def parsed(code, options = compiler_options) Opal::Compiler.new(code, options).parse end alias compile compiled def expect_compiled(code, options = compiler_options) expect(compiled(code, options)) end def compiler_for(code, options = compiler_options) Opal::Compiler.new(code, options).tap(&:compile) end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/for_rewriter_spec.rb
spec/lib/rewriters/for_rewriter_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' require 'opal/rewriters/for_rewriter' RSpec.describe Opal::Rewriters::ForRewriter do include RewritersHelper before(:each) { Opal::Rewriters::ForRewriter.reset_tmp_counter! } include_examples 'it rewrites source-to-AST', 'for i in (0..3); for j in (4..6); a = i + j; end; end', s(:begin, s(:lvdeclare, :i), s(:lvdeclare, :j), s(:lvdeclare, :a), s(:send, ast_of('(0..3)'), :each, s(:iter, s(:args, s(:arg, :$for_tmp1)), s(:begin, s(:initialize_iter_arg, :$for_tmp1), s(:lvasgn, :i, s(:js_tmp, :$for_tmp1)), s(:begin, s(:lvdeclare, :j), s(:lvdeclare, :a), s(:send, ast_of('(4..6)'), :each, s(:iter, s(:args, s(:arg, :$for_tmp2)), s(:begin, s(:initialize_iter_arg, :$for_tmp2), s(:lvasgn, :j, s(:js_tmp, :$for_tmp2)), s(:lvasgn, :a, s(:send, s(:lvar, :i), :+, s(:lvar, :j) ) ) ) ) ) ) ) ) ) ) include_examples 'it rewrites source-to-AST', 'for i in (0..3); a = 1; b = 2; end', s(:begin, s(:lvdeclare, :i), s(:lvdeclare, :a), s(:lvdeclare, :b), s(:send, ast_of('(0..3)'), :each, s(:iter, s(:args, s(:arg, :$for_tmp1)), s(:begin, s(:initialize_iter_arg, :$for_tmp1), s(:lvasgn, :i, s(:js_tmp, :$for_tmp1)), ast_of('a = 1'), ast_of('b = 2') ) ) ) ) include_examples 'it rewrites source-to-AST', 'for i, j in obj; a = 1; b, c = 2, 3; end', s(:begin, s(:lvdeclare, :i), s(:lvdeclare, :j), s(:lvdeclare, :a), s(:lvdeclare, :b), s(:lvdeclare, :c), s(:send, ast_of('obj'), :each, s(:iter, s(:args, s(:arg, :$for_tmp1)), s(:begin, s(:initialize_iter_arg, :$for_tmp1), s(:masgn, s(:mlhs, s(:lvasgn, :i), s(:lvasgn, :j)), s(:js_tmp, :$for_tmp1)), ast_of('a = 1'), ast_of('b, c = 2, 3') ) ) ) ) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/dot_js_syntax_spec.rb
spec/lib/rewriters/dot_js_syntax_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' RSpec.describe Opal::Rewriters::DotJsSyntax do include RewritersHelper context '.JS. syntax' do let(:send_node) do # a.JS.b(1) s(:send, s(:send, s(:lvar, :a), :JS), :b, s(:int, 1) ) end let(:dot_js_node) do s(:jscall, s(:lvar, :a), :b, s(:int, 1)) end it 'rewrites s(:send, s(:send, obj, :JS), :js_method, ...) to s(:jscall, obj, :js_method, ...)' do expect(rewriter.process(send_node)).to eq(dot_js_node) end end context '.JS[] syntax' do context 'when passed one argument' do let(:send_node) do # a.JS[1, 2] s(:send, s(:send, s(:lvar, :a), :JS), :[], s(:int, 1) ) end let(:jsattr_node) do s(:jsattr, s(:lvar, :a), s(:int, 1)) end it 'rewrites s(:send, s(:send, obj, :JS), :[], arg) to s(:jsattr, obj, arg)' do expect(rewriter.process(send_node)).to eq(jsattr_node) end end context 'when passed 1+ arguments' do let(:send_node) do # a.JS[1, 2] s(:send, s(:send, s(:lvar, :a), :JS), :[], s(:int, 1), s(:int, 2) ) end it 'raises syntax error' do expect { rewriter.process(send_node) }.to raise_error(Opal::RewritingError) end end end context '.JS[]= syntax' do context 'when passed two arguments' do let(:send_node) do # a.JS[1] = 2 s(:send, s(:send, s(:lvar, :a), :JS), :[]=, s(:int, 1), s(:int, 2) ) end let(:jsattr_asgn_node) do s(:jsattrasgn, s(:lvar, :a), s(:int, 1), s(:int, 2)) end it 'converts send node to jsattrasgn' do expect(rewriter.process(send_node)).to eq(jsattr_asgn_node) end end context 'when passed 2+ arguments' do let(:send_node) do # a.JS[1, 2] = 3 s(:send, s(:send, s(:lvar, :a), :JS), :[]=, s(:int, 1), s(:int, 2), s(:int, 3) ) end it 'raises syntax error' do expect { rewriter.process(send_node) }.to raise_error(Opal::RewritingError) end end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/forward_args_spec.rb
spec/lib/rewriters/forward_args_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' require 'opal/rewriters/forward_args' RSpec.describe Opal::Rewriters::ForwardArgs do include RewritersHelper before(:each) { Opal::Rewriters::ForRewriter.reset_tmp_counter! } correct_names = proc do |ast| case ast when Opal::AST::Node ast.children.map do |i| correct_names.(i) end.yield_self { |children| s(ast.type, *children) } when :fwd_rest "$fwd_rest" when :fwd_kwrest "$fwd_kwrest" when :fwd_block "$fwd_block" else ast end end include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) def forward(...) other(...) end ENDSOURCE def forward(*fwd_rest, &fwd_block) other(*fwd_rest, &fwd_block) end ENDDEST include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) def forward_star(*) other(*) end ENDSOURCE def forward_star(*fwd_rest) other(*fwd_rest) end ENDDEST include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) def forward_kwstar(**) other(**) end ENDSOURCE def forward_kwstar(**fwd_kwrest) other(**fwd_kwrest) end ENDDEST include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) def forward_block(&) other(&) end ENDSOURCE def forward_block(&fwd_block) other(&fwd_block) end ENDDEST include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) def forward(first_arg, ...) other(first_arg, second_arg, ...) other(other_arg, ...) other(...) end ENDSOURCE def forward(first_arg, *fwd_rest, &fwd_block) other(first_arg, second_arg, *fwd_rest, &fwd_block) other(other_arg, *fwd_rest, &fwd_block) other(*fwd_rest, &fwd_block) end ENDDEST end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/binary_operator_assignment_spec.rb
spec/lib/rewriters/binary_operator_assignment_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' RSpec.describe Opal::Rewriters::BinaryOperatorAssignment do include RewritersHelper use_only_described_rewriter! before(:each) { Opal::Rewriters::BinaryOperatorAssignment.reset_tmp_counter! } let(:cache_tmp_name) { :$binary_op_recvr_tmp_1 } let(:cached) { s(:js_tmp, cache_tmp_name) } context 'rewriting or_asgn and and_asgn nodes' do context 'local variable' do include_examples 'it rewrites source-to-source', 'a = 1; a += 2', 'a = 1; a = a + 2' end context 'instance variable' do include_examples 'it rewrites source-to-source', '@a += 1', '@a = @a + 1' end context 'constant' do include_examples 'it rewrites source-to-source', 'CONST += 1', 'CONST = CONST + 1' end context 'global variable' do include_examples 'it rewrites source-to-source', '$g += 1', '$g = $g + 1' end context 'class variable' do include_examples 'it rewrites source-to-source', '@@a += 1', '@@a = @@a + 1' end context 'simple method call' do include_examples 'it rewrites source-to-source', 'recvr = 1; recvr.meth += rhs', 'recvr = 1; recvr.meth = recvr.meth + rhs' end context '[] / []= method call' do include_examples 'it rewrites source-to-source', 'recvr = 1; recvr[idx] += rhs', 'recvr = 1; recvr[idx] = recvr[idx] + rhs' end context '[] / []= method call with multiple arguments' do include_examples 'it rewrites source-to-source', 'recvr = 1; recvr[idx1, idx2] += rhs', 'recvr = 1; recvr[idx1, idx2] = recvr[idx1, idx2] + rhs' end context 'chain of method calls' do it 'rewrites += by caching receiver to a temporary local variable' do input = parse('recvr.a.b += rhs') rewritten = rewrite(input).children.first expected = s(:begin, s(:lvasgn, cache_tmp_name, ast_of('recvr.a')), # cached = recvr.a s(:send, cached, :b=, s(:send, s(:send, cached, :b), :+, ast_of('rhs')))) expect(rewritten).to eq(expected) end end context 'method call using safe nafigator' do it 'rewrites += by caching receiver and rewriting it to if and or_asgn' do input = parse('recvr&.meth += rhs') rewritten = rewrite(input).children.first expected = s(:begin, s(:lvasgn, cache_tmp_name, ast_of('recvr')), # cached = recvr s(:if, s(:send, cached, :nil?), # if cached.nil? s(:nil), # nil # else s(:send, cached, :meth=, # cached.meth = s(:send, s(:send, cached, :meth), # cached.meth + :+, ast_of('rhs'))) # rhs )) # end expect(rewritten).to eq(expected) end end end context 'rewriting defined?(or_asgn) and defined?(and_asgn)' do context 'local variable' do include_examples 'it rewrites source-to-source', 'a = nil; defined?(a += 1)', 'a = nil; "assignment"' end context 'instance variable' do include_examples 'it rewrites source-to-source', 'defined?(@a += 1)', %q("assignment") end context 'constant' do include_examples 'it rewrites source-to-source', 'defined?(CONST += 1)', %q("assignment") end context 'global variable' do include_examples 'it rewrites source-to-source', 'defined?($g += 1)', %q("assignment") end context 'class variable' do include_examples 'it rewrites source-to-source', 'defined?(@@a += 1)', %q("assignment") end context 'simple method call' do include_examples 'it rewrites source-to-source', 'defined?(recvr.meth += rhs)', %q("assignment") end context '[] / []= method call' do include_examples 'it rewrites source-to-source', 'defined?(recvr[idx] += rhs)', %q("assignment") end context '[] / []= method call with multiple arguments' do include_examples 'it rewrites source-to-source', 'defined?(recvr[idx1, idx2] += rhs)', %q("assignment") end context 'chain of method calls' do include_examples 'it rewrites source-to-source', 'defined?(recvr.a.b.c += rhs)', %q("assignment") end context 'method call using safe nafigator' do include_examples 'it rewrites source-to-source', 'defined?(recvr&.meth += rhs)', %q("assignment") end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/opal_engine_check_spec.rb
spec/lib/rewriters/opal_engine_check_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' RSpec.describe Opal::Rewriters::OpalEngineCheck do include RewritersHelper let(:opal_str_sexp) { s(:str, 'opal') } let(:jruby_str_sexp) { s(:str, 'jruby') } let(:true_branch) { s(:int, 1) } let(:false_branch) { s(:int, 2) } [:RUBY_ENGINE, :RUBY_PLATFORM].each do |const_name| context "for #{const_name} constant" do let(:ruby_const_sexp) { s(:const, nil, const_name) } context "#{const_name} == rhs" do context "when rhs == 'opal'" do let(:check) do s(:send, ruby_const_sexp, :==, opal_str_sexp) end it 'replaces the expression with the true branch' do expect_rewritten( s(:if, check, true_branch, false_branch) ).to eq( true_branch ) end end context "when rhs == 'jruby'" do let(:check) do s(:send, ruby_const_sexp, :==, jruby_str_sexp) end it 'replaces the expression with the false branch' do expect_rewritten( s(:if, check, true_branch, false_branch) ).to eq( false_branch ) end end end context "#{const_name} != rhs" do context "when rhs == 'opal'" do let(:check) do s(:send, ruby_const_sexp, :!=, opal_str_sexp) end it 'replaces the expression with the false branch' do expect_rewritten( s(:if, check, true_branch, false_branch) ).to eq( false_branch ) end end context "when rhs == 'jruby'" do let(:check) do s(:send, ruby_const_sexp, :!=, jruby_str_sexp) end it 'replaces the expression with the true branch' do expect_rewritten( s(:if, check, true_branch, false_branch) ).to eq( true_branch ) end end end it 'supports nested blocks' do expect_rewritten( # if true # if RUBY_ENGINE == 'opal' # if RUBY_ENGINE == 'opal' # :a # end # if RUBY_ENGINE != 'opal' # :b # end # end # end s(:if, s(:true), s(:if, s(:send, ruby_const_sexp, :==, opal_str_sexp), s(:begin, s(:if, s(:send, ruby_const_sexp, :==, opal_str_sexp), s(:sym, :a) ), s(:if, s(:send, ruby_const_sexp, :!=, opal_str_sexp), s(:sym, :b) ) ) ) ) ).to eq( # if true # :a # nil # end s(:if, s(:true), s(:begin, s(:sym, :a), s(:nil) ) ) ) end end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/block_to_iter_spec.rb
spec/lib/rewriters/block_to_iter_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' RSpec.describe Opal::Rewriters::BlockToIter do include RewritersHelper let(:block_node) do # m { |arg1| 1 } s(:block, s(:send, nil, :m), s(:args, s(:arg, :arg1)), s(:int, 1) ) end let(:iter_node) do s(:send, nil, :m, s(:iter, s(:args, s(:arg, :arg1)), s(:int, 1)) ) end it 'rewriters s(:block) to s(:iter)' do expect(rewritten(block_node)).to eq(iter_node) end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/numblocks_spec.rb
spec/lib/rewriters/numblocks_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' require 'opal/rewriters/numblocks' RSpec.describe Opal::Rewriters::Numblocks do include RewritersHelper extend RewritersHelper # s() in example scope correct_names = proc do |ast| case ast when Opal::AST::Node ast.children.map do |i| correct_names.(i) end.yield_self { |children| s(ast.type, *children) } when :arg1 then :_1 when :arg2 then :_2 when :arg3 then :_3 else ast end end include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) proc do _1 end ENDSOURCE proc do |arg1| arg1 end ENDDEST include_examples 'it rewrites source-to-AST', <<~ENDSOURCE, correct_names.(ast_of(<<~ENDDEST)) proc do _3 end ENDSOURCE proc do |arg1, arg2, arg3| arg3 end ENDDEST end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/js_reserved_words_spec.rb
spec/lib/rewriters/js_reserved_words_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' RSpec.describe Opal::Rewriters::JsReservedWords do include RewritersHelper reserved_lvars = %i( do if in for let new try var case else enum eval false null this true void with break catch class const super throw while yield delete export import public return static switch typeof default extends finally package private continue debugger function arguments interface protected implements instanceof int byte char goto long final float short double native throws boolean abstract volatile transient synchronized NaN Infinity undefined ) reserved_ivars = %i( @constructor @displayName @hasOwnProperty @valueOf @__proto__ @__parent__ @__noSuchMethod__ @__count__ ) context 'reserved lvars' do reserved_lvars.each do |lvar_name| context 'as lvars' do it "appends '$'" do expect_rewritten( s(:lvar, lvar_name) ).to eq( s(:lvar, :"#{lvar_name}$") ) expect_rewritten( s(:lvasgn, lvar_name, s(:int, 1)) ).to eq( s(:lvasgn, :"#{lvar_name}$", s(:int, 1)) ) end end context 'as arguments' do it "appends '$'" do [:arg, :restarg, :blockarg, :shadowarg, :kwrestarg, :kwarg].each do |type| rewritten = rewrite(s(type, lvar_name)) expect(rewritten).to eq(s(type, :"#{lvar_name}$")) expect(rewritten.meta[:arg_name]).to eq(lvar_name) end [:optarg, :kwoptarg].each do |type| rewritten = rewrite(s(type, lvar_name, s(:nil))) expect(rewritten).to eq(s(type, :"#{lvar_name}$", s(:nil))) expect(rewritten.meta[:arg_name]).to eq(lvar_name) end end end end end context 'reserved ivars' do reserved_ivars.each do |ivar_name| it "appends '$' to :ivar #{ivar_name}" do expect_rewritten( s(:ivar, ivar_name) ).to eq( s(:ivar, :"#{ivar_name}$") ) end it "appends '$' to :ivasgn #{ivar_name}" do expect_rewritten( s(:ivasgn, ivar_name, s(:nil)) ).to eq( s(:ivasgn, :"#{ivar_name}$", s(:nil)) ) end end end context 'normal lvar name' do it 'does not modify AST' do expect_no_rewriting_for(s(:lvar, :a)) expect_no_rewriting_for(s(:lvasgn, :a)) end end context 'normal ivar name' do it 'does not modify AST' do [:arg, :restarg, :blockarg, :shadowarg, :kwarg, :kwrestarg].each do |type| rewritten = rewrite(s(type, :a)) expect(rewritten).to eq(s(type, :a)) expect(rewritten.meta[:arg_name]).to eq(:a) end [:optarg, :kwoptarg].each do |type| rewritten = rewrite(s(type, :a, s(:nil))) expect(rewritten).to eq(s(type, :a, s(:nil))) expect(rewritten.meta[:arg_name]).to eq(:a) end end end end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false
opal/opal
https://github.com/opal/opal/blob/b4e228990534515b83cd509a9297beca59bf8733/spec/lib/rewriters/returnable_logic_spec.rb
spec/lib/rewriters/returnable_logic_spec.rb
require 'lib/spec_helper' require 'support/rewriters_helper' require 'opal/rewriters/for_rewriter' RSpec.describe Opal::Rewriters::ReturnableLogic do include RewritersHelper extend RewritersHelper include_examples 'it rewrites source-to-AST', 'true or false', s(:if, s(:lvasgn, "$ret_or_1", s(:true)), s(:js_tmp, "$ret_or_1"), s(:false) ) include_examples 'it rewrites source-to-AST', 'true and false', s(:if, s(:lvasgn, "$ret_or_1", s(:true)), s(:false), s(:js_tmp, "$ret_or_1") ) include_examples 'it rewrites source-to-AST', 'true or next', s(:if, s(:lvasgn, "$ret_or_1", s(:true)), s(:js_tmp, "$ret_or_1"), s(:next) ) include_examples 'it rewrites source-to-AST', 'true and next', s(:if, s(:lvasgn, "$ret_or_1", s(:true)), s(:next), s(:js_tmp, "$ret_or_1") ) include_examples 'it rewrites source-to-AST', 'true or false or maybe', s(:if, s(:lvasgn, "$ret_or_1", s(:if, s(:lvasgn, "$ret_or_2", s(:true)), s(:js_tmp, "$ret_or_2"), s(:false) )), s(:js_tmp, "$ret_or_1"), s(:send, nil, :maybe) ) include_examples 'it rewrites source-to-AST', 'true and false and surely', s(:if, s(:lvasgn, "$ret_or_1", s(:if, s(:lvasgn, "$ret_or_2", s(:true)), s(:false), s(:js_tmp, "$ret_or_2") )), s(:send, nil, :surely), s(:js_tmp, "$ret_or_1") ) end
ruby
MIT
b4e228990534515b83cd509a9297beca59bf8733
2026-01-04T15:44:44.154940Z
false