GDPR-IAB-TCFv2

 view release on metacpan or  search on metacpan

bench/performance.pl  view on Meta::CPAN

    },
    '03_Validate' => sub {
      $simple_validator->validate($strings[$idx++ % @strings]);
    },
    '04_Validate_all' => sub {
      $simple_validator->validate_all($strings[$idx++ % @strings]);
    },
  }
);

print "\nAbsolute throughput (50_000 iterations, single-thread):\n";

for my $bench (
  ['Parse', sub { GDPR::IAB::TCFv2->Parse($strings[$idx++ % @strings]) }],
  [
    'Parse+TO_JSON',
    sub {
      my $tcf = GDPR::IAB::TCFv2->Parse($strings[$idx++ % @strings]);
      $tcf->TO_JSON;
    }
  ],

t/07-golden.t  view on Meta::CPAN

while (my $line_json = <$fh>) {
  chomp $line_json;
  next unless $line_json;

  my $entry     = $json->decode($line_json);
  my $tc_string = $entry->{tc_string};

  $count++;

  # Grouping each entry under a subtest collapses ~7 ok-records into 1 at the
  # outer level and lets Test2 release per-ok history between iterations.
  # Important for memory-tight smokers (e.g. OmniOS/Solaris on threaded perl).
  subtest "String $count" => sub {
    if ($entry->{expect_failure}) {
      throws_ok { GDPR::IAB::TCFv2->Parse($tc_string); }
      qr/\Q$entry->{error_match}\E/, "should fail as expected";
      return;
    }

    my $consent;
    lives_ok {



( run in 1.079 second using v1.01-cache-2.11-cpan-71847e10f99 )