Created
September 11, 2015 19:08
-
-
Save quadrophobiac/b2578166831b3c2bebec to your computer and use it in GitHub Desktop.
strange conditional logic in CSVLint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if type == :stray_quote && !wrapper.line.match(csv.row_sep) | |
# above evaluates to true && false | |
# however it is false only by placing bang against wrapper.line.match(csv.row_sep) which evals to either | |
# nil or MatchData - seems a strange way to order flow | |
# basically it want's whatever is matched against the row_sep (generated from the CSV.new of data inputted) to not match | |
# because if it matches then bang generates a false and only a stray_quote is logged | |
build_errors(:line_breaks, :structure) | |
# the tests that exist pass \r rather than \r\n when testing for line breaks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment