Guest User

Untitled

a guest
Apr 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. it "always taints resulting strings when self or regexp is tainted" do
  2. strs = ["hello world"]
  3. strs += strs.map { |s| s.dup.taint }
  4.  
  5. strs.each do |str|
  6. str = str.dup
  7. str.slice!(//, 0).tainted?.should == str.tainted?
  8. str.slice!(/hello/, 0).tainted?.should == str.tainted?
  9.  
  10. tainted_re = /(.)(.)(.)/
  11. tainted_re.taint
  12.  
  13. str.slice!(tainted_re, 1).tainted?.should == true
  14. end
  15. end
Add Comment
Please, Sign In to add comment