mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 14:43:05 -03:00
test: added tests for CSS generation
This commit is contained in:
@ -6,6 +6,9 @@ testcases = Dir.glob("#{__DIR__}/tests/**/*txt").sort
|
||||
# These are custom testcases
|
||||
examples = Dir.glob("#{__DIR__}/examples/**/*.*").reject(&.ends_with? ".json").sort!
|
||||
|
||||
# CSS Stylesheets
|
||||
css_files = Dir.glob("#{__DIR__}/css/*.css")
|
||||
|
||||
# These lexers don't load because of parsing issues
|
||||
failing_lexers = {
|
||||
"webgpu_shading_language",
|
||||
@ -81,6 +84,17 @@ describe Tartrazine do
|
||||
end
|
||||
end
|
||||
|
||||
describe "formatter" do
|
||||
css_files.each do |css_file|
|
||||
it "generates #{css_file}" do
|
||||
css = File.read(css_file)
|
||||
theme = Tartrazine.theme(File.basename(css_file, ".css"))
|
||||
formatter = Tartrazine::Html.new(theme: theme)
|
||||
formatter.style_defs.strip.should eq css.strip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "to_html" do
|
||||
it "should do basic highlighting" do
|
||||
html = Tartrazine.to_html("puts 'Hello, World!'", "ruby", standalone: false)
|
||||
|
Reference in New Issue
Block a user