Ticket #1068 (closed todo: fixed)

Opened 12 years ago

Last modified 12 years ago

Rename test files whose names are too similar

Reported by: jkeenan Owned by: jkeenan
Priority: trivial Milestone:
Component: testing Version: 1.6.0
Severity: low Keywords:
Cc: Language:
Patch status: Platform:

Description

Currently we have both t/pmc/object.t and t/pmc/objects.t. The similarity of the names frustrates easy tab-expansion.

t/pmc/object.t is supposed to test the Object PMC. There's not much in it yet; this comment appears:

# L<PDD15/Object PMC API>
## TODO add more tests as this is documented and implemented

t/pmc/objects.t, on the other hand, has nearly 200 tests in it. Its purpose is described as "Tests the object/class subsystem."

Can anyone suggest better names for one of these two files?

Thank you very much.
kid51

Change History

follow-up: ↓ 2   Changed 12 years ago by coke

On Sat, Sep 26, 2009 at 7:05 PM, Parrot <parrot-tickets@lists.parrot.org> wrote:
> #1068: Rename test files whose names are too similar
> ---------------------+------------------------------------------------------
>  Reporter:  jkeenan  |       Owner:
>     Type:  todo     |      Status:  new
>  Priority:  trivial  |   Milestone:
> Component:  testing  |     Version:  1.6.0
>  Severity:  low      |    Keywords:
>     Lang:           |       Patch:
>  Platform:           |
> ---------------------+------------------------------------------------------
>  Currently we have both ''t/pmc/object.t'' and ''t/pmc/objects.t''.  The
>  similarity of the names frustrates easy tab-expansion.
>
>  ''t/pmc/object.t'' is supposed to test the Object PMC.  There's not much
>  in it yet; this comment appears:
>  {{{
>  # L<PDD15/Object PMC API>
>  ## TODO add more tests as this is documented and implemented
>  }}}
>
>  ''t/pmc/objects.t'', on the other hand, has nearly 200 tests in it.  Its
>  purpose is described as ''"Tests the object/class subsystem."''
>
>  Can anyone suggest better names for one of these two files?
>
>  Thank you very much.[[BR]]
>  kid51
>

my 2¢:  In general, I expect t/pmc to be tests for individual PMCs;
tests of the object system in general belong in t/oo. (This said
without examining the contents of objects.t)

-- 
Will "Coke" Coleda

in reply to: ↑ 1   Changed 12 years ago by jkeenan

Replying to coke:

my 2¢: In general, I expect t/pmc to be tests for individual PMCs; tests of the object system in general belong in t/oo. (This said without examining the contents of objects.t) -- Will "Coke" Coleda

t/pmc/objects.t has a sub main() which declares a plan and then invokes many other subs:

.sub main :main
    .include 'test_more.pir'
    .include "iglobals.pasm"
    .include "interpinfo.pasm"

    plan(194)

    get_classname_from_class()
    test_get_class()
    test_isa()
    does_scalar()
    does_array()
    new_object()
    new_object__isa_test()
    new_object__classname()
...
}

Here, for example, is the sub whose failure, discussed in TT #1067, led me to look at this file in the first place:

.sub PMC_as_classes__derived_3
    .local pmc MyInt10
    .local pmc MyInt10_2
    get_class $P0, "Integer"

    subclass MyInt10, $P0, "MyInt10"
    addattribute MyInt10, 'intval'
    get_class $P1, "MyInt10"
    subclass MyInt10_2, $P1, "MyInt10_2"

    .local pmc i
    i = new "MyInt10_2"
    $I0 = isa i, "Integer"
    ok( $I0, 'obj isa grandparent (Integer)' )
    $I0 = isa i, "MyInt10"
    ok( $I0, 'obj isa parent (MyInt10)' )
    $I0 = isa i, "MyInt10_2"
    ok( $I0, 'obj isa its class (MyInt102)' )

    i = 42    # set_integer is overridden below
    $I0 = i   # get_integer is overridden below
    is( $I0, 42, 'set/get_integer overridden' )

    $S0 = i   # get_string is overridden below
    is( $S0, 'MyInt10_2(42)', 'set/get_string overridden' )
.end

Does this make a case for moving the file to t/oo? If so, I will do so once we resolve TT #1067.

Thank you very much.
kid51

  Changed 12 years ago by jkeenan

  • owner set to jkeenan
  • status changed from new to assigned

Per discussion on #parrot with Coke, this was done in r47587.

kid51

  Changed 12 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

Closing.

Note: See TracTickets for help on using tickets.