case uses the triple-equal === operator to test each case.
However, I do not know why your example does not work:
> c = "\"" > c == "\"" => true > c === "\"" => true
Try removing .each and explicitly setting c to the quote character and see what happens.
As a rule, === more forgiving than == in Ruby, so I canβt imagine the case when == will match, but === will not.
Edit: I just copied your code with the same input (file with a single character " ) and received the following output:
Quote QuoteCase Err ErrCase
(last two from a new line at the end of the file that Vim insists on).
Skilldrick
source share