Ticket #309 (new enhancement)

Opened 7 years ago

Last modified 6 years ago

tests in mixins

Reported by: kobi7 Owned by:
Priority: major Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:


can we have tests in mixins?
initializing the mixin, like a normal class, and then asserting.
I currently refer to tests in the mixin's body, not the method's body.

for example:

mixin ABC
    var h = 3
        p = ABC()
        assert p.h == 3

Change History

Changed 7 years ago by kobi7

currently in svn 2848.
the error I get is "The modifier static is not valid for this item"
referring to the 'test' keyword.

Changed 6 years ago by hopscc

  • type changed from defect to enhancement

Changed 6 years ago by nerdzero

You can create a helper class as a workaround.

mixin ABC
    var h =3
class ABCTest adds ABC
        p = ABCTest()
        assert p.h == 3
    def main
Note: See TracTickets for help on using tickets.