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

Commit

Permalink
Fixed supposed error for dynamic tests.
Browse files Browse the repository at this point in the history
CallSiteVariablesEliminated test deleted.
VerbatimDynamic test moved to FailingTests class.
  • Loading branch information
iskiselev committed Dec 5, 2015
1 parent 1287657 commit 7b08c67
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
18 changes: 18 additions & 0 deletions Tests/FailingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,23 @@ public void FailingTestCases (object[] parameters) {
protected IEnumerable<TestCaseData> FailingTestCasesSource () {
return FolderTestSource("FailingTestCases", MakeDefaultProvider(), new AssemblyCache());
}

[Test]
public void VerbatimDynamic()
{
try
{
var js = GetJavascript(
@"SpecialTestCases\Issue548.cs",
"{\"obj1\":\"{}\"}"
);
}
catch (Exception)
{
return;
}

Assert.Fail("Test passed when it should have failed");
}
}
}
24 changes: 0 additions & 24 deletions Tests/FormattingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -819,30 +819,6 @@ public void InterfaceVariance () {
}
}

[Test]
public void CallSiteVariablesEliminated () {
var output = "a\r\n6";
var generatedJs = GetJavascript(
@"TestCases\DynamicReturnTypes.cs",
output, () => {
var cfg = MakeConfiguration();
cfg.CodeGenerator.CacheTypeExpressions = true;
return cfg;
}
);

try {
Assert.IsFalse(
generatedJs.Contains(".CallSite"),
"A CallSite was not fully eliminated"
);
} catch {
Console.WriteLine(generatedJs);

throw;
}
}

[Test]
public void SpuriousIntegerHints () {
var output = "0F0F\r\n7773";
Expand Down
4 changes: 2 additions & 2 deletions Tests/MetadataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public void ComplexDynamics () {

Assert.Fail("Translated JS ran successfully");
} catch (JavaScriptEvaluatorException jse) {
Assert.IsTrue(jse.ToString().Contains("TypeError: document is undefined"), jse.ToString());
Assert.IsTrue(jse.ToString().Contains("TypeError: realTarget is undefined"), jse.ToString());
}
}

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

Assert.Fail("Translated JS ran successfully");
} catch (JavaScriptEvaluatorException jse) {
Assert.IsTrue(jse.ToString().Contains("TypeError: obj is undefined"), jse.ToString());
Assert.IsTrue(jse.ToString().Contains("TypeError: realTarget is undefined"), jse.ToString());
}
}

Expand Down
8 changes: 0 additions & 8 deletions Tests/VerbatimTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,5 @@ public void VerbatimVariablesExistingArray () {
"hello\r\n7"
);
}

[Test]
public void VerbatimDynamic () {
var js = GetJavascript(
@"SpecialTestCases\Issue548.cs",
"{\"obj1\":\"{}\"}"
);
}
}
}

0 comments on commit 7b08c67

Please sign in to comment.