<commit_before>#!perl
# Copyright (C) 2007, The Perl Foundation.
# $Id$

use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test tests => 1;

=head1 NAME

t/oo/names.t - Test OO name-related items

=head1 SYNOPSIS

    % prove t/oo/names.t

=head1 DESCRIPTION

Tests OO features related to names and namespaces.

=cut

pir_output_is(
    <<'CODE', <<'OUT', 'Create HLL class same-named as Parrot class', todo => 'RT #43419' );
    .HLL "perl6", ""

    .namespace []

    .sub main :main
        # works
        $P0 = new 'Class'
        $P0.'name'('AnObject')
        $S0 = $P0
        say $S0

        # fails
        $P0 = new 'Class'
        $P0.'name'('Object')
        $S0 = $P0
        say $S0
    .end
CODE
perl6;AnObject
perl6;Object
OUT

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4:<commit_msg>RT#60512: [PATCH] rewrite of names.t to PIR Courtesy of Bruce Stockwell<commit_after>#! parrot
# Copyright (C) 2007-2008, The Perl Foundation.
# $Id$

=head1 NAME

t/oo/names.t - Test OO name-related items

=head1 SYNOPSIS

    % prove t/oo/names.t

=head1 DESCRIPTION

Tests OO features related to names and namespaces.

=cut

.HLL "perl6", ""

.namespace []

.sub main :main
    .include 'include/test_more.pir'

    plan(2)

    hll_object_different_than_parrot_name()
    hll_object_same_as_parrot_name()
.end

.sub hll_object_different_than_parrot_name
    # works
    $P0 = new 'Class'
    $P0.'name'('AnObject')
    $S0 = $P0
    is ($S0, 'AnObject','HLL obj w/ name different than parrot obj created')
.end

.sub hll_object_same_as_parrot_name
    # fails
    $P0 = new 'Class'
    push_eh OK_1
    $P0.'name'('Object')
    pop_eh
    $S0 = $P0
    ok (0, 'HLL obj created w/ same name as parrot obj')
    .return()
OK_1:    
    ok (1, 'HLL obj w/ same name as parrot obj not created')
.end

# Local Variables:
#   mode: pir 
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
{'fraction_non_alphanumeric': 0.13316831683168318, 'fraction_numerical': 0.032673267326732675, 'mean_word_length': 2.708256880733945, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5234232', 'n_tokens_mistral': 835, 'n_tokens_neox': 777, 'n_words': 222}