Skip to content

Commit

Permalink
Revert "Add rapidyaml transformations"
Browse files Browse the repository at this point in the history
This reverts commit 913f82c.
  • Loading branch information
biojppm committed May 28, 2024
1 parent a1dc1bc commit 1e454fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
9 changes: 0 additions & 9 deletions bin/compare-framework-tests
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use YAML::PP;
use YAML::Matrix qw/
minimal_events
hsyaml_event_to_event
rapidyaml_event_to_event
generate_expected_output
load_csv gather_tags
/;
Expand Down Expand Up @@ -222,14 +221,6 @@ sub compare_tests {
$tests->{ $id }->{minimal_events} = \@test_events;
$tests->{ $id }->{transformed_events} = \@events;
}
elsif ($view eq "cpp-rapidyaml.event") {
@test_events = io
->file("$matrixdir/expected/$id/minimal.rapid.event")
->encoding('utf-8')->chomp->slurp;
$tests->{ $id }->{minimal_events} = \@test_events;
@events = rapidyaml_event_to_event(@events);
$tests->{ $id }->{transformed_events} = \@events;
}
elsif ($view eq "rust-yamlrust.event") {
@test_events = io
->file("$matrixdir/expected/$id/minimal.rust.event")
Expand Down
15 changes: 1 addition & 14 deletions lib/perl5/YAML/Matrix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use base 'Exporter';
our @EXPORT_OK = qw/
minimal_events minimal_events_for_framework
hsyaml_event_to_event
rapidyaml_event_to_event
generate_expected_output
load_csv gather_tags
/;
Expand All @@ -23,10 +22,6 @@ sub minimal_events_for_framework {
$args{no_explicit_doc} = 1;
$args{no_quoting_style} = 1;
}
elsif ($type eq 'rapid') {
$args{no_quoting_style} = 1;
$args{no_flow_indicator} = 1;
}
elsif ($type eq 'flow') {
$args{no_flow_indicator} = 1;
}
Expand Down Expand Up @@ -105,14 +100,6 @@ sub hsyaml_event_to_event {
return @events;
}

sub rapidyaml_event_to_event {
my (@events) = @_;
for my $event (@events) {
$event =~ s/^(\=VAL (&\S+ )?(<[^>]+> )?)["']/$1:/;
}
return @events;
}

sub gather_tags {
my ($dir) = @_;
my %tags;
Expand Down Expand Up @@ -151,7 +138,7 @@ sub generate_expected_output {
my %expected;

my @test_events = io->file("$dir/test.event")->chomp->encoding('utf-8')->slurp;
for my $typw (qw/ rust cpp flow rapid /) {
for my $typw (qw/ rust cpp flow /) {
my @minimal = minimal_events_for_framework($typw, @test_events);
$expected{"minimal.$typw.event"} = join '', map { "$_\n" } @minimal;
}
Expand Down

0 comments on commit 1e454fa

Please sign in to comment.