Skip to content

Instantly share code, notes, and snippets.

@seth
Created March 17, 2011 05:28
Show Gist options
  • Save seth/873884 to your computer and use it in GitHub Desktop.
Save seth/873884 to your computer and use it in GitHub Desktop.
Example of multi-generator list comprehension to generate a matrix of test cases
term_special_chars_test_() ->
SpecialChars = ["!", "(", ")", "{", "}", "[", "]",
"^", "\"", "~", "*", "?", ":", "\\"],
Formats = ["foo~sbar", "~sb", "a~s", "a~sb"],
Terms = [ ?i2b(io_lib:format(F, ["\\" ++ C])) ||
F <- Formats, C <- SpecialChars ],
[ ?_assertEqual(T, hd(lucene:parse(T))) || T <- Terms ].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment