Sha256: 7ff1f3fbe05839958f46ad2c8e3fe8bda557b45b1086348da1179c64be876b13
Contents?: true
Size: 611 Bytes
Versions: 10
Compression:
Stored size: 611 Bytes
Contents
require 'livetext' require 'formatline' def red(str) "[31m" + str + "[0m" end input = ARGV.first || "test/data/lines.txt" data = File.readlines(input) data.each_slice(4) do |lines| title, input, expected, blank = *lines input.chomp! expected.chomp! expected = eval(expected) if expected[0] == "/" puts "-----------------------------" print "Test: #{title}" actual = FormatLine.parse!(input) next if expected === actual puts "Input: #{input}" puts " #{red('FAIL Expected: ')} #{expected.inspect}" puts " #{red(' Actual : ')} #{actual.inspect}" puts end
Version data entries
10 entries across 10 versions & 1 rubygems