Closed NCCastillo closed 11 years ago
Here is a simplified example of this error:
1.times do
if true
break
end
end
It blows up b/c of a void value expression. E.g. same reason this blows up when run in normal Ruby:
1.times do
puts(if true
break
end)
end
I don't know how to fix this without either making the regex super duper overly hyper conservative, or actually parsing Ruby for real. I'd prefer the latter, but it's beyond me at the moment, so this probably won't be fixed for a while :(
It blew up because SeeingIsBelieving isn't good enough >.< Please log an issue at: https://github.com/JoshCheek/seeing_is_believing/issues
Program: "begin;($seeing_is_believing_current_result.record_result(9, (def destroy_message(string)\n($seeing_is_believing_current_result.record_result(2, ( matched_string = string.match(/:/))))\n($seeing_is_believing_current_result.record_result(7, ( if matched_string \n($seeing_is_believing_current_result.record_result(4, ( \"#{matched_string.pre_match}#{matchedstring}\")))\n else\n return \"this has no message\"\n end)))\n #string[/\A[^:]:/]\nend)))\n\n($seeing_is_believing_current_result.record_result(14, (def destroy_message!(string)\n # matched_string = string.match(/:/)\n($seeing_is_believing_current_result.recordresult(13, ( string.sub!(/(?<=:)./,''))))\nend)))\n\n# Driver code... \n($seeing_is_believing_current_result.record_result(17, (string = \"this message will self-destruct: you can't hug every cat\")))\n($seeing_is_believing_current_result.record_result(18, (original_string = string.dup)))\n($seeing_is_believing_current_result.record_result(19, (puts destroy_message(string) == \"this message will self-destruct:\")))\nputs string == original_string # we shouldn't modify the string passed to destroy_message\n\n($seeing_is_believing_current_result.record_result(22, (string = \"this has no message\")))\n($seeing_is_believing_current_result.record_result(23, (original_string = string.dup)))\n($seeing_is_believing_current_result.record_result(24, (puts destroy_message(string) == string)))\nputs string == original_string # we shouldn't modify the string passed to destroy_message\n\n($seeing_is_believing_current_result.record_result(27, (string = \"this message will self-destruct: you can't hug every cat\")))\n($seeing_is_believing_current_result.record_result(28, (original_string = string.dup)))\n($seeing_is_believing_current_result.record_result(29, (puts destroy_message!(string) == \"this message will self-destruct:\")))\n($seeing_is_believing_current_result.record_result(30, (puts string == \"this message will self-destruct:\")))\n($seeing_is_believing_current_result.record_result(31, (puts string != original_string)))\n\n($seeing_is_believing_current_result.record_result(33, (string = \"this has no message\")))\n($seeing_is_believing_current_result.record_result(34, (result = destroy_message!(string))))\n($seeing_is_believing_current_result.record_result(35, (puts result.nil?)))\n($seeing_is_believing_current_result.record_result(36, (puts string == string)))\n\nrescue Exception;line_number = $!.backtrace.grep(/#{FILE}/).first[/:\d+/][1..-1].to_i;$seeing_is_believing_current_result.record_exception line_number, $!;end"
Code that generated this: