-
-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] adjust for macro API changes
- Loading branch information
Showing
32 changed files
with
130 additions
and
122 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
tests/misc/projects/Issue10844/user-defined-define-json-fail.hxml.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(unknown) : Uncaught exception Could not read file define.jsno | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:509: characters 11-39 : Called from here | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:505: characters 11-39 : Called from here | ||
(unknown) : Called from here |
2 changes: 1 addition & 1 deletion
2
tests/misc/projects/Issue10844/user-defined-meta-json-fail.hxml.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(unknown) : Uncaught exception Could not read file meta.jsno | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:498: characters 11-39 : Called from here | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:494: characters 11-39 : Called from here | ||
(unknown) : Called from here |
2 changes: 1 addition & 1 deletion
2
tests/misc/projects/Issue10844/user-defined-meta-json-indent-fail.hxml.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(unknown) : Uncaught exception Could not read file meta.jsno | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:498: characters 11-39 : Called from here | ||
$$normPath(::std::)/haxe/macro/Compiler.hx:494: characters 11-39 : Called from here | ||
(unknown) : Called from here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
class Main { | ||
static function test() { | ||
var t = haxe.macro.Context.getType("A"); | ||
function fail(msg) { | ||
Sys.println(msg); | ||
Sys.exit(1); | ||
} | ||
switch (t) { | ||
case TAbstract(a, _): | ||
var hasTestMeta = Lambda.exists(a.get().impl.get().meta.get(), function(m) return m.name == ":test"); | ||
if (!hasTestMeta) { | ||
fail("Abstract implementation class has no @:test metadata"); | ||
} | ||
case _: | ||
fail("Should be abstract"); | ||
} | ||
|
||
haxe.macro.Context.onAfterInitMacros(() -> { | ||
var t = haxe.macro.Context.getType("A"); | ||
switch (t) { | ||
case TAbstract(a, _): | ||
var hasTestMeta = Lambda.exists(a.get().impl.get().meta.get(), function(m) return m.name == ":test"); | ||
if (!hasTestMeta) { | ||
fail("Abstract implementation class has no @:test metadata"); | ||
} | ||
case _: | ||
fail("Should be abstract"); | ||
} | ||
}); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import haxe.macro.Context; | ||
|
||
class Main3 { | ||
static function init() { | ||
Context.onAfterInitMacros(() -> { | ||
function defineType(name, kind) { | ||
Context.defineType({ | ||
pack: [], | ||
name: name, | ||
pos: (macro 0).pos, | ||
kind: kind, | ||
fields: [] | ||
}); | ||
} | ||
|
||
defineType("lowercase", TDClass()); | ||
|
||
defineType("0_class", TDClass()); | ||
defineType("0_enum", TDEnum); | ||
defineType("0_struct", TDStructure); | ||
defineType("0_abstract", TDAbstract(TPath({pack: [], name: "Int"}))); | ||
}); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Main3.hx:10: characters 18-19 : Module "lowercase" does not have a valid name. Module name should start with an uppercase letter: "lowercase" | ||
Main3.hx:10: characters 18-19 : Module "0_class" does not have a valid name. "0_class" is not a valid module name. | ||
Main3.hx:10: characters 18-19 : Module "0_enum" does not have a valid name. "0_enum" is not a valid module name. | ||
Main3.hx:10: characters 18-19 : Module "0_struct" does not have a valid name. "0_struct" is not a valid module name. | ||
Main3.hx:10: characters 18-19 : "0_abstract_Impl_" is not a valid type name. | ||
Main3.hx:10: characters 18-19 : Module "0_abstract" does not have a valid name. "0_abstract" is not a valid module name. |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--macro Macro.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Macro.hx:5: characters 60-61 : Warning : ok | ||
Macro.hx:8: characters 42-43 : Warning : after init 1 | ||
Package "hax.ds" was not found in any of class paths | ||
Macro.hx:14: characters 42-43 : Warning : after init 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--macro Macro.init() | ||
--macro Macro.init_fail() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
Macro.hx:7: characters 60-61 : Warning : ok | ||
Macro.hx:11: characters 42-43 : Warning : after init 1 | ||
Macro.hx:12: characters 3-32 : Warning : This API should only be used from initialization macros. | ||
Package "hax.ds" was not found in any of class paths | ||
Macro.hx:17: characters 42-43 : Warning : after init 2 | ||
Macro.hx:20: characters 2-19 : Cannot use this API from initialization macros. | ||
Macro.hx:20: characters 2-19 : ... Use `Context.onAfterInitMacros` to register a callback to run when context is ready. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
Macro.hx:8: characters 17-18 : "" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must not be empty | ||
Macro.hx:8: characters 17-18 : "\n" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:8: characters 17-18 : "pack\n" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Invalid character: \n | ||
Macro.hx:8: characters 17-18 : "pack~" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Invalid character: ~ | ||
Macro.hx:8: characters 17-18 : "Foo" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:8: characters 17-18 : "0_class" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:8: characters 17-18 : "0_enum" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:8: characters 17-18 : "0_structure" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:8: characters 17-18 : "0_abstract" is not a valid package name: | ||
Macro.hx:8: characters 17-18 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must not be empty | ||
Macro.hx:9: characters 18-19 : "\n" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "pack\n" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Invalid character: \n | ||
Macro.hx:9: characters 18-19 : "pack~" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Invalid character: ~ | ||
Macro.hx:9: characters 18-19 : "Foo" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "0_class" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "0_enum" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "0_structure" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter | ||
Macro.hx:9: characters 18-19 : "0_abstract" is not a valid package name: | ||
Macro.hx:9: characters 18-19 : Package name must start with a lowercase letter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Macro2.hx:7: characters 17-18 : Module "" does not have a valid name. Module name must not be empty. | ||
Macro2.hx:7: characters 17-18 : Module "0" does not have a valid name. "0" is not a valid module name. | ||
Macro2.hx:7: characters 17-18 : Module "Type+" does not have a valid name. "Type+" is not a valid module name. | ||
Macro2.hx:8: characters 18-19 : Module "" does not have a valid name. Module name must not be empty. | ||
Macro2.hx:8: characters 18-19 : Module "0" does not have a valid name. "0" is not a valid module name. | ||
Macro2.hx:8: characters 18-19 : Module "Type+" does not have a valid name. "Type+" is not a valid module name. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters