Skip to content

Commit

Permalink
Move out to unsupported more filters from String bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Nov 22, 2013
1 parent 7827aeb commit 25ff1b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions spec/opal/filters/bugs/string.rb
Expand Up @@ -66,7 +66,6 @@
fails "String#gsub with pattern and replacement treats \\+ as an empty string if there was no captures"
fails "String#gsub with pattern and replacement maps \\\\ in replacement to \\"
fails "String#gsub with pattern and replacement handles pattern collapse without $KCODE"
fails "String#gsub with pattern and replacement untrusts the result if the original string or replacement is untrusted"
fails "String#gsub with pattern and replacement raises a TypeError when replacement can't be converted to a string"
fails "String#gsub with pattern and replacement sets $~ to MatchData of last match and nil when there's none"
fails "String#gsub with pattern and Hash returns a copy of self with all occurrences of pattern replaced with the value of the corresponding hash key"
Expand All @@ -80,15 +79,9 @@
fails "String#gsub with pattern and Hash uses the hash's value set from default_proc for missing keys"
fails "String#gsub with pattern and Hash sets $~ to MatchData of last match and nil when there's none for access from outside"
fails "String#gsub with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
fails "String#gsub with pattern and Hash untrusts the result if the original string is untrusted"
fails "String#gsub with pattern and Hash untrusts the result if a hash value is untrusted"
fails "String#gsub with pattern and block sets $~ for access from the block"
fails "String#gsub with pattern and block restores $~ after leaving the block"
fails "String#gsub with pattern and block sets $~ to MatchData of last match and nil when there's none for access from outside"
fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"

fails "String#index raises a TypeError if passed a Symbol"

Expand Down Expand Up @@ -197,8 +190,6 @@
fails "String#split with Regexp returns a type error if limit can't be converted to an integer"
fails "String#split with Regexp returns subclass instances based on self"
fails "String#split with Regexp does not call constructor on created subclass instances"
fails "String#split with Regexp retains the encoding of the source string"
fails "String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied"

fails "String#start_with? ignores arguments not convertible to string"
fails "String#start_with? converts its argument using :to_str"
Expand Down
7 changes: 7 additions & 0 deletions spec/opal/filters/unsupported/encoding.rb
Expand Up @@ -30,5 +30,12 @@

fails "String#each_char is unicode aware"

fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"

fails "String#split with Regexp retains the encoding of the source string"
fails "String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied"

fails "String#upcase is locale insensitive (only replaces a-z)"
end
5 changes: 5 additions & 0 deletions spec/opal/filters/unsupported/trusted.rb
Expand Up @@ -58,4 +58,9 @@
fails "Array#to_s untrusts the result if the Array is untrusted"

fails "String#chop untrusts result when self is untrusted"

fails "String#gsub with pattern and replacement untrusts the result if the original string or replacement is untrusted"
fails "String#gsub with pattern and Hash untrusts the result if the original string is untrusted"
fails "String#gsub with pattern and Hash untrusts the result if a hash value is untrusted"
fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
end

0 comments on commit 25ff1b0

Please sign in to comment.