Skip to content

Commit 25ff1b0

Browse files
committedNov 22, 2013
Move out to unsupported more filters from String bugs
1 parent 7827aeb commit 25ff1b0

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed
 

Diff for: ‎spec/opal/filters/bugs/string.rb

-9
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
fails "String#gsub with pattern and replacement treats \\+ as an empty string if there was no captures"
6767
fails "String#gsub with pattern and replacement maps \\\\ in replacement to \\"
6868
fails "String#gsub with pattern and replacement handles pattern collapse without $KCODE"
69-
fails "String#gsub with pattern and replacement untrusts the result if the original string or replacement is untrusted"
7069
fails "String#gsub with pattern and replacement raises a TypeError when replacement can't be converted to a string"
7170
fails "String#gsub with pattern and replacement sets $~ to MatchData of last match and nil when there's none"
7271
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"
@@ -80,15 +79,9 @@
8079
fails "String#gsub with pattern and Hash uses the hash's value set from default_proc for missing keys"
8180
fails "String#gsub with pattern and Hash sets $~ to MatchData of last match and nil when there's none for access from outside"
8281
fails "String#gsub with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
83-
fails "String#gsub with pattern and Hash untrusts the result if the original string is untrusted"
84-
fails "String#gsub with pattern and Hash untrusts the result if a hash value is untrusted"
8582
fails "String#gsub with pattern and block sets $~ for access from the block"
8683
fails "String#gsub with pattern and block restores $~ after leaving the block"
8784
fails "String#gsub with pattern and block sets $~ to MatchData of last match and nil when there's none for access from outside"
88-
fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
89-
fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
90-
fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
91-
fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
9285

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

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

203194
fails "String#start_with? ignores arguments not convertible to string"
204195
fails "String#start_with? converts its argument using :to_str"

Diff for: ‎spec/opal/filters/unsupported/encoding.rb

+7
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,12 @@
3030

3131
fails "String#each_char is unicode aware"
3232

33+
fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
34+
fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
35+
fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
36+
37+
fails "String#split with Regexp retains the encoding of the source string"
38+
fails "String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied"
39+
3340
fails "String#upcase is locale insensitive (only replaces a-z)"
3441
end

Diff for: ‎spec/opal/filters/unsupported/trusted.rb

+5
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@
5858
fails "Array#to_s untrusts the result if the Array is untrusted"
5959

6060
fails "String#chop untrusts result when self is untrusted"
61+
62+
fails "String#gsub with pattern and replacement untrusts the result if the original string or replacement is untrusted"
63+
fails "String#gsub with pattern and Hash untrusts the result if the original string is untrusted"
64+
fails "String#gsub with pattern and Hash untrusts the result if a hash value is untrusted"
65+
fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
6166
end

0 commit comments

Comments
 (0)
Please sign in to comment.