diff options
| author | Ben Sanders <ben@sanders.life> | 2026-08-02 09:49:25 -0400 |
|---|---|---|
| committer | Ben Sanders <ben@sanders.life> | 2026-08-02 09:49:25 -0400 |
| commit | b41479c91e6685511c1f8ba8586106b322073b62 (patch) | |
| tree | c9f1345999d754ae0a533849966427e792d9e68d /vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb | |
| parent | cfaceeb9a6d1295f5754be211858155cd309acc2 (diff) | |
added statscounter code
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb')
| -rw-r--r-- | vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb b/vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb new file mode 100644 index 0000000..5c819e0 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/kramdown-2.5.2/test/run_tests.rb @@ -0,0 +1,46 @@ +# -*- coding: utf-8; frozen_string_literal: true -*- +# +#-- +# Copyright (C) 2009-2026 Thomas Leitner <t_leitner@gmx.at> +# +# This file is part of kramdown which is licensed under the MIT. +#++ +# + +$:.unshift File.dirname(__FILE__) + '/../lib' +require 'kramdown' +require 'test/unit/assertions' +require 'yaml' + +include Test::Unit::Assertions + +arg = ARGV[0] || File.join(File.dirname(__FILE__), 'testcases') + +arg = if File.directory?(arg) + File.join(arg, '**/*.text') + else + arg + '.text' + end + +width = ((size = `stty size 2>/dev/null`).length > 0 ? size.split.last.to_i : 72) rescue 72 +width -= 8 +fwidth = 0 +Dir[arg].each {|f| fwidth = [fwidth, f.length + 10].max }.each do |file| + print(('Testing ' + file + ' ').ljust([fwidth, width].min)) + $stdout.flush + + html_file = file.sub('.text', '.html') + opts_file = file.sub('.text', '.options') + opts_file = File.join(File.dirname(file), 'options') unless File.exist?(opts_file) + options = File.exist?(opts_file) ? YAML.safe_load(File.read(opts_file)) : {auto_ids: false, footnote_nr: 1} + doc = Kramdown::Document.new(File.read(file), options) + begin + assert_equal(File.read(html_file), doc.to_html) + puts 'PASSED' + rescue StandardError + puts ' FAILED' + puts $!.message if $VERBOSE + puts $!.backtrace if $DEBUG + end + puts "Warnings:\n" + doc.warnings.join("\n") if !doc.warnings.empty? && $VERBOSE +end |
