### ----------------------------------------------------
### -- Grok
### -- Licenses: Artistic-2.0
### -- Authors: Jeff Armstrong
### -- File: t/30-grok-sample-types.rakutest
### ----------------------------------------------------
use v6.d+;

use Test;
use Test::Output;

plan 10;

use lib $?FILE.IO.parent;
use TestUtils;

use Grok;

for (
  Any                                    ,
  Bool                                   ,
  DateTime                               ,
  Endian                                 ,
  Junction                               ,
  Raku                                   ,
  Signature                              ,
  Stringy                                ,
  UInt                                   ,
  Version                                ,
) -> $thing {

  my $file = get-output-name($thing).IO;

  # Generate reference output
  $file.spurt( output-from({grok($thing)}).&purified )
    unless $file.e;

  # Test reference output
  is  output-from( { grok($thing) } ).&purified,
      $file.IO.slurp,
      $thing.^name;

}

say 'done';

done-testing;


