1
0
Fork 0

Test parameterized traits with named staging object

* test/Trait/NamedTest.js: Add regression test.
  Update copyright to include 2017.
master
Mike Gerwitz 2017-06-30 02:04:09 -04:00
parent ae196d5de5
commit a35ecc6f94
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
1 changed files with 22 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/** /**
* Tests named trait definitions * Tests named trait definitions
* *
* Copyright (C) 2014, 2016 Free Software Foundation, Inc. * Copyright (C) 2014, 2016, 2017 Free Software Foundation, Inc.
* *
* This file is part of GNU ease.js. * This file is part of GNU ease.js.
* *
@ -209,4 +209,25 @@ require( 'common' ).testCase(
// ensure that trait was properly named // ensure that trait was properly named
this.assertOk( T.toString().match( name ) ); this.assertOk( T.toString().match( name ) );
}, },
/**
* This is a regression test for a bug whereby `#__mixin' was not
* properly detected when extending a class, preventing a trait from
* becoming parameterized. This was actually fixed when implementing
* named trait extending (and noticed on a version that did not have it
* implemented), but it's still an important test.
*/
'Can create parameterized trait using named staging object': function()
{
var C = this.Class( {} );
this.assertOk( this.Sut.isParameterTrait(
this.Sut( 'Foo' ).extend( C,
{
// makes it parameterized
__mixin: function() {},
} )
) );
},
} ); } );