2025-10-11 21:47:24 +01:00
|
|
|
using System.Threading.Tasks;
|
2023-10-07 12:36:28 +02:00
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Godot.SourceGenerators.Tests;
|
|
|
|
|
|
|
|
|
|
public class ScriptPropertyDefValGeneratorTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
2025-10-11 21:47:24 +01:00
|
|
|
public async Task ExportedFields()
|
2023-10-07 12:36:28 +02:00
|
|
|
{
|
|
|
|
|
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
|
|
|
|
|
new string[] { "ExportedFields.cs", "MoreExportedFields.cs" },
|
|
|
|
|
new string[] { "ExportedFields_ScriptPropertyDefVal.generated.cs" }
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
2025-10-11 21:47:24 +01:00
|
|
|
public async Task ExportedProperties()
|
2023-10-07 12:36:28 +02:00
|
|
|
{
|
|
|
|
|
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
|
|
|
|
|
"ExportedProperties.cs",
|
|
|
|
|
"ExportedProperties_ScriptPropertyDefVal.generated.cs"
|
|
|
|
|
);
|
|
|
|
|
}
|
2024-02-29 12:57:27 +01:00
|
|
|
|
2025-03-16 08:55:46 +01:00
|
|
|
[Fact]
|
2025-10-11 21:47:24 +01:00
|
|
|
public async Task ExportedProperties2()
|
2025-03-16 08:55:46 +01:00
|
|
|
{
|
|
|
|
|
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
|
|
|
|
|
"ExportedProperties2.cs", "ExportedProperties2_ScriptPropertyDefVal.generated.cs");
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-29 12:57:27 +01:00
|
|
|
[Fact]
|
2025-10-11 21:47:24 +01:00
|
|
|
public async Task ExportedComplexStrings()
|
2024-02-29 12:57:27 +01:00
|
|
|
{
|
|
|
|
|
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
|
|
|
|
|
"ExportedComplexStrings.cs",
|
|
|
|
|
"ExportedComplexStrings_ScriptPropertyDefVal.generated.cs"
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-10-07 12:36:28 +02:00
|
|
|
}
|