Remove no longer needed test files.

These tests were sucecssfully converted to Rust files to include and are
no longer necessary in this repository.
Should they become relevant again in the future, they can always be
checked out from a previous commit.
This commit is contained in:
Ethiraric 2024-03-21 12:37:10 +01:00
parent 2fe52cf1c2
commit 580d7b0525
5 changed files with 0 additions and 1628 deletions

View file

@ -1,78 +0,0 @@
#!/usr/bin/env ruby
TEST_REGEX = /TEST_F\([a-zA-Z0-9_]+,\s+([a-zA-Z0-9_]+)\)/
DISABLED_TESTS = %w(
test_ex7_10_plain_characters
test_ex7_17_flow_mapping_separate_values
test_ex7_21_single_pair_implicit_entries
test_ex7_2_empty_nodes
test_ex8_2_block_indentation_header
)
class Context
attr_accessor :name, :ev, :src
def initialize
@name = ""
@src = ""
@ev = []
end
end
class String
def snakecase
self
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.tr('-', '_')
.gsub(/\s/, '_')
.gsub(/__+/, '_')
.downcase
end
end
ctx = nil
tests = []
IO.foreach(ARGV[0]) do |line|
line.strip!
if ctx
fail "unexpected TEST_F" if line =~ TEST_REGEX
if line =~ /^}/
tests << ctx
ctx = nil
end
if line =~ /^EXPECT_CALL/
fail 'not end with ;' unless line[-1] == ';'
v = line.gsub('(', ' ').gsub(')', ' ').split
ctx.ev << v[2]
end
else
next unless line =~ TEST_REGEX
name = $1
next unless name =~ /^(Ex\d+_\d+)/
str = $1.upcase
$stderr.puts "found #{name}"
ctx = Context.new
ctx.name = "test_#{name.snakecase}"
ctx.src = str
end
end
# code gen
tests.each do |t|
next if t.ev.size == 0
if DISABLED_TESTS.include? t.name
puts "#[allow(dead_code)]"
else
puts "#[test]"
end
puts "fn #{t.name}() {"
puts " let mut v = str_to_test_events(#{t.src}).into_iter();"
t.ev.each do |e|
puts " assert_next!(v, TestEvent::#{e});"
end
puts "}"
puts
end

File diff suppressed because it is too large Load diff

View file

@ -1,6 +0,0 @@
# Ex 8.18
plain key: in-line value
: # Both empty
"quoted key":
- entry

View file

@ -1,7 +0,0 @@
# Ex 7.17
{
unqoted : "separate",
http://foo.com,
omitted value:,
: omitted key,
}

View file

@ -1,5 +0,0 @@
# ex 7.2
{
foo : !!str,
!!str : bar,
}