Closed rukbotto closed 10 years ago
Hi,
The 0.0.x -beta release of tink macros on haxelib (released last week) had a number of breaking changes to packages and classes.
Unfortunately running Mockatoo in haxe 3 is depend on these (unstable) 0.x versions of tink macros (the haxe 2 versions were a proper 1.x release).
I will try to update this dependency in the near future, but your best option right now is to switch back to an earlier version of tink macros 0,0.x on haxelib
I started making some of the changes:
https://github.com/jasononeil/mockatoo/tree/new_tink
I got it compiling for my thing, but the unit tests don't compile. As an example, in the MockatooStubbingTest.should_generate_returns()
test:
Mockatoo.returns(instance.toString(), "foo");
instance.toString().returns("bar");
these should both do the same thing. The first works, the second gives:
Invalid expression [@:this this]
Trying to trace the differences, I was looking in StubbingMacro.returns
, and the difference between those two calls was:
StubbingMacro.returns(
instance.toString(), "foo")
StubbingMacro.returns(
@:this this, "bar")
I have no idea why this is happening... going to leave it for now. If anyone wants to continue though I thought maybe what I'd found so far might be helpful.
Thanks for a superb mocking framework!
Unfortunately it stopped working for me as well when I updated the tink_* libs. What versions of tink_core and tink_macro do I need to have in order for mockatoo to work?
It should run against these versions in Haxe 3.0:
I ran into this while looking through the new Haxe manual, probably related when me (or someone) gets around to trying to patch mockatoo to work with latest tink, and apparently, latest Haxe development versions:
since Haxe 3.1.0
The combination of static extensions and macros was reworked for the 3.1.0 release. The Haxe Compiler does not even try to find the original expression for the macro argument and instead passes a special @:this this expression. While the structure of this expression conveys no information, the expression can still be typed correctly:
...
http://haxe.jasono.co/manual/macro-limitations-static-extension.html
Closing this as mockatoo 3.0.x (on master) no longer depends on tink_macros, and is compatible with Haxe 3.1.x
Hi there,
I'm trying to run this test case:
But I'm hitting this exception when running the above test case with
munit
:I checked further and found
tink.macro.tools.MacroTools
is not present intink_macro
package. However, it is present intinker_macros
package, which is not available for Haxe 3.