File: 90ex_synopsis.t

package info (click to toggle)
libparser-mgc-perl 0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 536 kB
  • sloc: perl: 1,881; makefile: 2; sh: 1
file content (25 lines) | stat: -rw-r--r-- 385 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

use lib ".";
require "examples/synopsis.pl";

my $parser = LispParser->new;

sub test
{
   my ( $str, $expect ) = @_;

   is( $parser->from_string( $str ), [ $expect ], qq("$str") );
}

test "123", 123;
test "'hello'", 'hello';
test "(123 456)", [ 123, 456 ];
test "(+ 1 (* 2 3))", [ \'+', 1, [ \'*', 2, 3 ] ];

done_testing;