diff --git a/Tests/Projects/Basic/Test.yarn b/Tests/Projects/Basic/Test.yarn index c045c71c6..c886bac8d 100644 --- a/Tests/Projects/Basic/Test.yarn +++ b/Tests/Projects/Basic/Test.yarn @@ -22,5 +22,5 @@ This still works! title: ThirdNode tags: multiple tags! --- - +<> === \ No newline at end of file diff --git a/Tests/TestCases/FormatFunctions.yarn b/Tests/TestCases/FormatFunctions.yarn index 953389013..168d27fad 100644 --- a/Tests/TestCases/FormatFunctions.yarn +++ b/Tests/TestCases/FormatFunctions.yarn @@ -62,4 +62,5 @@ Mae: Wow, I came [ordinal value={$race_position} one="%st" two="%nd" few="%rd" o title: Destination --- // no-op +<>> === \ No newline at end of file diff --git a/Tests/TestCases/InlineExpressions.yarn b/Tests/TestCases/InlineExpressions.yarn index 6811d1ee4..988f0a281 100644 --- a/Tests/TestCases/InlineExpressions.yarn +++ b/Tests/TestCases/InlineExpressions.yarn @@ -36,4 +36,5 @@ title: Destination --- // no-op; required because the test plan will select // an option at the end of 'Start' and they all end up here +<> === \ No newline at end of file diff --git a/Tests/TestCases/NodeHeaders.yarn b/Tests/TestCases/NodeHeaders.yarn index b0742708e..d780fdb38 100644 --- a/Tests/TestCases/NodeHeaders.yarn +++ b/Tests/TestCases/NodeHeaders.yarn @@ -5,17 +5,21 @@ title: Start // TestNode1 demonstrates a node with two headers: its title, and a populated tag header. // TestNode2 demonstrates a node with two headers: its title, and a tag header with no text. // TestNode3 demonstrates a node with three headers: its title, an empty tag, and a populated tag. +<> === title: TestNode1 tags: one two --- +<> === title: TestNode2 tags: --- +<> === title: TestNode3 tags: test: example --- +<> === diff --git a/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.upgraded.yarn b/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.upgraded.yarn index 190b0cf8d..f597e6595 100644 --- a/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.upgraded.yarn +++ b/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.upgraded.yarn @@ -64,4 +64,5 @@ A line after the shortcut options. title: End --- // End of script +<> === \ No newline at end of file diff --git a/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.yarn b/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.yarn index 688ff4810..32c070705 100644 --- a/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.yarn +++ b/Tests/Upgrader/V1toV2/SimplifiedOptions/SimplifiedOptions.yarn @@ -46,4 +46,5 @@ A line after the shortcut options. title: End --- // End of script +<> === \ No newline at end of file diff --git a/YarnSpinner.Tests/ErrorHandlingTests.cs b/YarnSpinner.Tests/ErrorHandlingTests.cs index 944a3c3b7..4dc24e66e 100644 --- a/YarnSpinner.Tests/ErrorHandlingTests.cs +++ b/YarnSpinner.Tests/ErrorHandlingTests.cs @@ -80,5 +80,20 @@ public void TestInvalidFunctionCall() result.Diagnostics.Should().Contain(d => d.Message.Contains(@"Unexpected "">>"" while reading a function call")); } + + // testing that warnings are generated for empty nodes + [Fact] + public void TestEmptyNodesGenerateWarnings() + { + var source = CreateTestNode("", "Start"); + + var result = Compiler.Compile(CompilationJob.CreateFromString("", source)); + + var warnings = result.Diagnostics.Where(d => d.Severity == Diagnostic.DiagnosticSeverity.Warning); + // there should be only one warning + warnings.Count().Should().Be(1); + // and it should be the warning about empty nodes + warnings.FirstOrDefault().Message.Should().Be("Node \"Start\" is empty and will not be included in the compiled output."); + } } } diff --git a/YarnSpinner.Tests/ProjectTests.cs b/YarnSpinner.Tests/ProjectTests.cs index 4f8c03e2b..ae62a3fbe 100644 --- a/YarnSpinner.Tests/ProjectTests.cs +++ b/YarnSpinner.Tests/ProjectTests.cs @@ -36,7 +36,6 @@ public void TestLoadingNodes() dialogue.NodeExists("TestNode").Should().BeTrue(); dialogue.NodeExists("AnotherTestNode").Should().BeTrue(); dialogue.NodeExists("ThirdNode").Should().BeTrue(); - } [Fact] diff --git a/YarnSpinner.Tests/UpgraderTests.cs b/YarnSpinner.Tests/UpgraderTests.cs index 4060d485e..21d861657 100644 --- a/YarnSpinner.Tests/UpgraderTests.cs +++ b/YarnSpinner.Tests/UpgraderTests.cs @@ -17,7 +17,6 @@ public class UpgraderTests : TestBase [MemberData(nameof(DirectorySources), "Upgrader/V1toV2")] public void TestUpgradingV1toV2(string directory) { - Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine($"INFO: Loading file {directory}");