Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Commit 7b08c67

Browse files
committed
Fixed supposed error for dynamic tests.
CallSiteVariablesEliminated test deleted. VerbatimDynamic test moved to FailingTests class.
1 parent 1287657 commit 7b08c67

4 files changed

Lines changed: 20 additions & 34 deletions

File tree

Tests/FailingTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,23 @@ public void FailingTestCases (object[] parameters) {
8484
protected IEnumerable<TestCaseData> FailingTestCasesSource () {
8585
return FolderTestSource("FailingTestCases", MakeDefaultProvider(), new AssemblyCache());
8686
}
87+
88+
[Test]
89+
public void VerbatimDynamic()
90+
{
91+
try
92+
{
93+
var js = GetJavascript(
94+
@"SpecialTestCases\Issue548.cs",
95+
"{\"obj1\":\"{}\"}"
96+
);
97+
}
98+
catch (Exception)
99+
{
100+
return;
101+
}
102+
103+
Assert.Fail("Test passed when it should have failed");
104+
}
87105
}
88106
}

Tests/FormattingTests.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -819,30 +819,6 @@ public void InterfaceVariance () {
819819
}
820820
}
821821

822-
[Test]
823-
public void CallSiteVariablesEliminated () {
824-
var output = "a\r\n6";
825-
var generatedJs = GetJavascript(
826-
@"TestCases\DynamicReturnTypes.cs",
827-
output, () => {
828-
var cfg = MakeConfiguration();
829-
cfg.CodeGenerator.CacheTypeExpressions = true;
830-
return cfg;
831-
}
832-
);
833-
834-
try {
835-
Assert.IsFalse(
836-
generatedJs.Contains(".CallSite"),
837-
"A CallSite was not fully eliminated"
838-
);
839-
} catch {
840-
Console.WriteLine(generatedJs);
841-
842-
throw;
843-
}
844-
}
845-
846822
[Test]
847823
public void SpuriousIntegerHints () {
848824
var output = "0F0F\r\n7773";

Tests/MetadataTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public void ComplexDynamics () {
446446

447447
Assert.Fail("Translated JS ran successfully");
448448
} catch (JavaScriptEvaluatorException jse) {
449-
Assert.IsTrue(jse.ToString().Contains("TypeError: document is undefined"), jse.ToString());
449+
Assert.IsTrue(jse.ToString().Contains("TypeError: realTarget is undefined"), jse.ToString());
450450
}
451451
}
452452

@@ -460,7 +460,7 @@ public void ComplexDynamicsMonoBinary () {
460460

461461
Assert.Fail("Translated JS ran successfully");
462462
} catch (JavaScriptEvaluatorException jse) {
463-
Assert.IsTrue(jse.ToString().Contains("TypeError: obj is undefined"), jse.ToString());
463+
Assert.IsTrue(jse.ToString().Contains("TypeError: realTarget is undefined"), jse.ToString());
464464
}
465465
}
466466

Tests/VerbatimTests.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,5 @@ public void VerbatimVariablesExistingArray () {
7878
"hello\r\n7"
7979
);
8080
}
81-
82-
[Test]
83-
public void VerbatimDynamic () {
84-
var js = GetJavascript(
85-
@"SpecialTestCases\Issue548.cs",
86-
"{\"obj1\":\"{}\"}"
87-
);
88-
}
8981
}
9082
}

0 commit comments

Comments
 (0)