Skip to content

Commit 8c7bfb2

Browse files
committed
More Haxe tests, finished them for now.
- Abstracts. - Functions types and function types with subtypes. - Regions. - Comments. - Classes implementing interfaces.
1 parent b2980fa commit 8c7bfb2

File tree

8 files changed

+365
-1
lines changed

8 files changed

+365
-1
lines changed

Tests/External/Plugins/ASCompletion.Tests/ASCompletion.Tests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@
131131
<EmbeddedResource Include="Test Files\haxe\MultiLineStringsTest.hx" />
132132
<EmbeddedResource Include="Test Files\haxe\EscapedStringsTest.hx" />
133133
<EmbeddedResource Include="Test Files\haxe\EnumsTest.hx" />
134+
<EmbeddedResource Include="Test Files\haxe\AbstractsTest.hx" />
135+
<EmbeddedResource Include="Test Files\haxe\RegionsTest.hx" />
136+
<EmbeddedResource Include="Test Files\haxe\FunctionTypesTest.hx" />
137+
<EmbeddedResource Include="Test Files\haxe\FunctionTypesWithSubTypesTest.hx" />
138+
<EmbeddedResource Include="Test Files\haxe\CommentsTest.hx" />
139+
<EmbeddedResource Include="Test Files\haxe\SpecialClassesCommentsTest.hx" />
134140
</ItemGroup>
135141
<ItemGroup>
136142
<ProjectReference Include="..\..\..\..\External\Plugins\AS2Context\AS2Context.csproj">

Tests/External/Plugins/ASCompletion.Tests/Model/ASFileParserTests.cs

Lines changed: 269 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package;
2+
3+
abstract AbstractInt(Int) {
4+
inline public function new(i:Int) {
5+
this = i;
6+
}
7+
}
8+
9+
abstract MyAbstract(Int) from Int to Int {
10+
inline function new(i:Int) {
11+
this = i;
12+
}
13+
}
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
package;
22

3+
/**
4+
* Some custom comments
5+
*/
36
class Test
47
{
5-
public function new()
8+
///
9+
/// Java Style comments
10+
///
11+
public function new() {}
12+
13+
/**
14+
* Some method documentation
15+
*/
16+
public function testAdd(arg1:Int, arg2:Int):Int
617
{
18+
return arg1 + arg2; // Just some single line comment as well for code coverage
719
}
820
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public function new()
2+
{
3+
var functionType:Dynamic->Dynamic;
4+
var functionType2:Int->Int->Int;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public function new()
2+
{
3+
var functionType:(Dynamic->Dynamic)->Dynamic;
4+
var functionType2:((Dynamic->Dynamic)->Int->)Int;
5+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package;
2+
3+
class Test
4+
{
5+
//{region Fields
6+
private var _test:String;
7+
//}endregion
8+
9+
//#region invalid
10+
private var _test2:String;
11+
//#endregion
12+
13+
private function regionInside():String
14+
{
15+
//{region Complex stuff
16+
//this is really complex!
17+
//}endregion
18+
}
19+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package;
2+
3+
/**
4+
* Some typedef custom comments
5+
*/
6+
typedef TypedefTest
7+
{
8+
///
9+
/// Java Style comments
10+
///
11+
var age : Int;
12+
}
13+
14+
/**
15+
* Some enum custom comments
16+
*/
17+
enum EnumTest
18+
{
19+
/**
20+
* Enum element comments
21+
*/
22+
Foo;
23+
}
24+
25+
/**
26+
* Some abstract custom comments
27+
*/
28+
abstract AbstractInt(Int) {
29+
///
30+
/// Java Style comments
31+
///
32+
inline public function new(i:Int) {
33+
this = i;
34+
}
35+
}

0 commit comments

Comments
 (0)