blns_spec.cr 973 B

12345678910111213141516171819202122232425262728293031323334
  1. require "./spec_helper"
  2. require "./blns"
  3. # The BLNS tests merely test that `markdownToHtml` does not throw or hang while
  4. # processing "naughty string" inputs. While there are examples of multi-byte
  5. # characters, non-visible characters, etc., these tests should not be _relied
  6. # upon_ for testing multi-byte character support, etc.
  7. describe BLNS do
  8. # This is more a test of update_blns.cr: we're testing that the strings
  9. # were encoded half-decently, and nothing got globbed up into a big
  10. # multiline string.
  11. it "parsing blns" do
  12. BLNS.size.should eq 515
  13. end
  14. index = 0
  15. BLNS.each do |str|
  16. it "BLNS String #{index}" do
  17. result = Luce.to_html(str)
  18. result.should be_a String
  19. end
  20. index += 1
  21. end
  22. index = 0
  23. BLNS.each do |str|
  24. it "BLNS String #{index} w/ ExtensionSet::GITHUB_WEB" do
  25. result = Luce.to_html(str, extension_set: Luce::ExtensionSet::GITHUB_WEB)
  26. result.should be_a String
  27. end
  28. index += 1
  29. end
  30. end