#!perl
# Copyright (C) 2005-2008, Parrot Foundation.

use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );

use Parrot::Test tests => 1;

=head1 NAME

t/examples/namespace.t - Test examples in F<examples/namespace>

=head1 SYNOPSIS

    % prove t/examples/namespace.t

=head1 DESCRIPTION

Test the examples in F<examples/namespace>.

=head1 SEE ALSO

F<t/examples/pir.t>

=head1 AUTHOR

Bernhard Schmalhofer - <Bernhard.Schmalhofer@gmx.de>

=cut

# Set up expected output for examples

# cannot test the exact result, just adding one method somewhere
# changes all. Also namespaces are hashes.  And we do not guarantee any specific
# order of keys.  test the name of the 2 toplevel names,  parrot is using
my %expected = (
    'namespace_dump.pir' => << 'END_EXPECTED',
/(?:^parrot.*
^MULTI\s=>\sMULTI)|(?:^MULTI\s=>\sMULTI.*
^parrot.*)/sm
END_EXPECTED
);

while ( my ( $example, $expected ) = each %expected ) {
    example_output_like( "examples/namespace/$example", $expected );
}

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4:
