-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/354.wide-arch
# Conflicts: # Cesium.CodeGen.Tests/ArchitectureDependentCodeTests.cs # Cesium.CodeGen.Tests/verified/ArchitectureDependentCodeTests.PointerArrayMemberAssign_arch=Bit32.verified.txt # Cesium.CodeGen.Tests/verified/ArchitectureDependentCodeTests.PointerArrayMemberAssign_arch=Bit64.verified.txt # Cesium.CodeGen.Tests/verified/ArchitectureDependentCodeTests.PointerArrayMemberAssign_arch=Dynamic.verified.txt # Cesium.CodeGen/Ir/BlockItems/FunctionDeclaration.cs # Cesium.CodeGen/Ir/BlockItems/FunctionDefinition.cs # Cesium.Runtime/RuntimeHelpers.cs # Cesium.Runtime/StdIoFunctions.cs # Cesium.Runtime/StdLibFunctions.cs # Cesium.Runtime/StringFunctions.cs # docs/architecture-sets.md # docs/type-system.md
- Loading branch information
Showing
337 changed files
with
7,236 additions
and
3,040 deletions.
There are no files selected for viewing
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
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
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,43 @@ | ||
using JetBrains.Annotations; | ||
|
||
namespace Cesium.CodeGen.Tests; | ||
|
||
public class CodeGenEnumTests : CodeGenTestBase | ||
{ | ||
[MustUseReturnValue] | ||
private static Task DoTest(string source) | ||
{ | ||
var assembly = GenerateAssembly(default, source); | ||
|
||
var moduleType = assembly.Modules.Single().GetType("<Module>"); | ||
return VerifyMethods(moduleType); | ||
} | ||
|
||
[Fact] | ||
public Task EnumDeclarationTest() => DoTest(@" | ||
enum Colour { Red, Green, Blue }; | ||
void test() | ||
{ | ||
enum Colour x = Green; | ||
}"); | ||
|
||
[Fact] | ||
public Task EnumDeclarationIntTest() => DoTest(@" | ||
enum Colour { Red, Green, Blue }; | ||
void test() | ||
{ | ||
enum Colour x = 42; | ||
}"); | ||
|
||
[Fact] | ||
public Task EnumUsageInIf() => DoTest(@" | ||
enum Colour { Red, Green, Blue }; | ||
void test() | ||
{ | ||
enum Colour x = 42; | ||
if (x == Green) ; | ||
}"); | ||
} |
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
Oops, something went wrong.