Skip to content

Commit 1a12a80

Browse files
author
SlavaRa
authored
Small refactoring + test for HaxeFoundation#27. closes HaxeFoundation#27
1 parent 1b60f05 commit 1a12a80

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

.editorconfig

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ root = true
33
indent_style = space
44
indent_size = 4
55
end_of_line = crlf
6-
charset = utf-8
7-
trim_trailing_whitespace = true
6+
charset = utf-8

test/issues/Issue27.as

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package {
2+
public class Issue27 {
3+
public function Issue27(condition:Boolean) {
4+
if (condition) trace(1);
5+
6+
//some comment
7+
trace(2);
8+
}
9+
}
10+
}

test/issues/Issue27.hx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
class Issue27
3+
{
4+
public function new(condition : Bool)
5+
{
6+
if (condition)
7+
{
8+
trace(1);
9+
}
10+
11+
//some comment
12+
trace(2);
13+
}
14+
}

test/issues/Issue314.as

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package {
2-
public class Issue303 {
3-
public function Issue303() {}
2+
public class Issue314 {
3+
public function Issue314() {}
44
public function hide1(param1:*) : *
55
{
66
this[param1] = false;

test/issues/Issue314.hx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
class Issue303
2+
class Issue314
33
{
44
public function new()
55
{

test/unit/as3hx/AS3HXTest.hx

+5
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,11 @@ class AS3HXTest {
566566
generate("Issue314.as", "Issue314.hx");
567567
}
568568

569+
@Test("https://github.com/HaxeFoundation/as3hx/issues/27")
570+
public function issue27() {
571+
generate("Issue27.as", "Issue27.hx");
572+
}
573+
569574
function generate(as3FileName:String, expectedHaxeFileName:String) {
570575
var issuesDirectory = FileSystem.absolutePath("test/issues");
571576
var generatedDirectoryPath = '$issuesDirectory/generated';

0 commit comments

Comments
 (0)