Skip to content

Commit

Permalink
Merge pull request #27 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
prepare 0.29.0
  • Loading branch information
aliokan authored Sep 2, 2017
2 parents 5413b34 + 45e5aef commit 1cd3bef
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ install:
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexInject.git ./hexinject
- haxelib dev hexinject ./hexinject
#tink_macro
- haxelib install tink_macro 0.14.0
- haxelib install tink_macro 0.14.1
#hexDSL
- haxelib dev hexdsl .
- export DISPLAY=:99.0;
Expand Down
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"dependencies":
{
"hexinject": "git:https://github.com/DoclerLabs/hexInject.git",
"tink_macro": "0.14.0"
"tink_macro": "0.14.1"
}
}
15 changes: 2 additions & 13 deletions src/hex/compiletime/flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,7 @@ var myString = factory.locate( 'myString' );
```haxe
@context( name = 'applicationContext' )
{
@inject_into(a, b, c) instance = new hex.mock.MockClassWithInjectedProperty();
}
```
</details>

<details>
<summary>Create an instance using context's injector</summary>

```haxe
@context( name = 'applicationContext' )
{
@injector_creation instance = new hex.mock.MockClassWithInjectedProperty();
@inject_into instance = new hex.mock.MockClassWithInjectedProperty();
}
```
</details>
Expand Down Expand Up @@ -784,4 +773,4 @@ var myString = factory.locate( 'myString' );
p2 = new hex.structures.Point( 3, 4 );
}
```
</details>
</details>
21 changes: 8 additions & 13 deletions test/MainDslTest.hx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package;

import hex.HexDslSuite;
import hex.unittest.runner.ExMachinaUnitCore;
import hex.unittest.notifier.TraceNotifier;

#if js
import hex.unittest.notifier.ConsoleNotifier;
#elseif flash
import flash.Lib;
#end

/**
* ...
Expand All @@ -20,14 +14,15 @@ class MainDslTest
var emu = new ExMachinaUnitCore();

#if flash
emu.addListener( new TraceNotifier( Lib.current.loaderInfo, false, true ) );
#elseif js
emu.addListener( new ConsoleNotifier( false ) );
emu.addListener( new hex.unittest.notifier.TraceNotifier( flash.Lib.current.loaderInfo, false, true ) );
#elseif (php && haxe_ver < 4.0)
emu.addListener( new hex.unittest.notifier.TraceNotifier( ) );
#else
emu.addListener( new TraceNotifier( false ) );
emu.addListener( new hex.unittest.notifier.ConsoleNotifier( ) );
#end
emu.addListener( new hex.unittest.notifier.ExitingNotifier( ) );

emu.addTest( hex.HexDslSuite );
emu.addTest( HexDslSuite );
emu.run();
}
}
}
6 changes: 6 additions & 0 deletions test/context/flow/enumArgument.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@context( name = 'applicationContext' )
{
color = hex.mock.MockColor.Red;
colored = new hex.mock.MockColorable( color );
colored2 = new hex.mock.MockColorable( hex.mock.MockColor.Red );
}
3 changes: 2 additions & 1 deletion test/context/flow/primitives/uint.flow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@context( name = 'applicationContext' )
{
@type( 'UInt' )
i = 3;
}
}
5 changes: 5 additions & 0 deletions test/context/xml/enumArgument.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<root name="applicationContext">
<model id="colored" type="hex.mock.MockColorable">
<argument static-ref="hex.mock.MockColor.Red" />
</model>
</root>
9 changes: 9 additions & 0 deletions test/hex/compiletime/flow/BasicFlowCompilerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1001,4 +1001,13 @@ class BasicFlowCompilerTest
Assert.isInstanceOf( map, MockClass );
Assert.equals( this._getCoreFactory().locate( "test" ), map );
}

@Test( "test enum argument" )
public function testEnumArgument() : Void
{
this._applicationAssembler = BasicFlowCompiler.compile( "context/flow/enumArgument.flow" );
Assert.equals( hex.mock.MockColor.Red, this._getCoreFactory().locate( "color" ) );
Assert.equals( hex.mock.MockColor.Red, this._getCoreFactory().locate( "colored" ).color );
Assert.equals( hex.mock.MockColor.Red, this._getCoreFactory().locate( "colored2" ).color );
}
}
11 changes: 11 additions & 0 deletions test/hex/compiletime/flow/BasicStaticFlowCompilerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1272,5 +1272,16 @@ class BasicStaticFlowCompilerTest

Assert.equals( mock, code.locator.alias );
}

@Test( "test enum argument" )
public function testEnumArgument() : Void
{
var code = BasicStaticFlowCompiler.compile( this._myApplicationAssembler, "context/flow/enumArgument.flow", "BasicStaticFlowCompiler_testEnumArgument" );
code.execute();

Assert.equals( hex.mock.MockColor.Red, code.locator.color );
Assert.equals( hex.mock.MockColor.Red, code.locator.colored.color );
Assert.equals( hex.mock.MockColor.Red, code.locator.colored2.color );
}
}

9 changes: 9 additions & 0 deletions test/hex/compiletime/xml/BasicXmlCompilerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import hex.mock.MockClass;
import hex.mock.MockClassWithGeneric;
import hex.mock.MockClassWithInjectedProperty;
import hex.mock.MockClassWithoutArgument;
import hex.mock.MockColorable;
import hex.mock.MockContextHolder;
import hex.mock.MockFruitVO;
import hex.mock.MockInjectee;
Expand Down Expand Up @@ -911,4 +912,12 @@ class BasicXmlCompilerTest
Assert.equals( 1, MockTriggerListener.callbackCount );
Assert.equals( 'hello world', MockTriggerListener.message );
}*/

@Test( "test enum argument" )
public function testEnumArgument() : Void
{
this._applicationAssembler = BasicXmlCompiler.compile( "context/xml/enumArgument.xml" );
var colored : MockColorable = cast this._locate( "colored" );
Assert.equals( hex.mock.MockColor.Red, colored.color );
}
}
11 changes: 11 additions & 0 deletions test/hex/mock/MockColor.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package hex.mock;

/**
* @author Francis Bourre
*/
enum MockColor
{
Red;
Green;
Blue;
}
17 changes: 17 additions & 0 deletions test/hex/mock/MockColorable.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package hex.mock;

import hex.mock.MockColor;

/**
* ...
* @author Francis Bourre
*/
class MockColorable
{
public var color : MockColor;

public function new( color : MockColor )
{
this.color = color;
}
}

0 comments on commit 1cd3bef

Please sign in to comment.