04-format.t 735 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!perl -T
  2. use 5.006;
  3. use strict;
  4. use warnings;
  5. use Test::More;
  6. plan tests => 17;
  7. use Perl::Tokenizer qw(perl_tokens);
  8. my $code = <<'EOT';
  9. format STDOUT_TOP =
  10. CHR ORD USED
  11. -----------------------------------
  12. .
  13. format STDOUT =
  14. @>> @>>>>>> @>>>>>>
  15. $white_spaces{$key} // chr $key, $key, $table{$key}
  16. .
  17. EOT
  18. my @tokens = qw(
  19. keyword
  20. horizontal_space
  21. bare_word
  22. horizontal_space
  23. assignment_operator
  24. vertical_space
  25. format
  26. vertical_space
  27. keyword
  28. horizontal_space
  29. special_fh
  30. horizontal_space
  31. assignment_operator
  32. vertical_space
  33. format
  34. vertical_space
  35. );
  36. perl_tokens {
  37. is($_[0], shift(@tokens));
  38. } $code;
  39. ok(scalar(@tokens) == 0);