Skip to content

Commit

Permalink
Fix unit test to work with threaded model where exceptions don't bubb…
Browse files Browse the repository at this point in the history
…le up.
  • Loading branch information
kogir committed Dec 2, 2011
1 parent 754e7bb commit 0dfb3ee
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions SassAndCoffee.Core.Tests/CoffeeScriptCompilerTest.cs
@@ -1,13 +1,10 @@
namespace SassAndCoffee.Core.Tests
{
using System;

using SassAndCoffee.Core;
using SassAndCoffee.Core.Compilers;

using Xunit;

using SassAndCoffee.Core;

public class CoffeeScriptCompilerTest
{
[Fact]
Expand All @@ -26,17 +23,19 @@ public void CoffeeScriptFailTest()
var input = "@#)$(@#)(@#_$)(@_)@ !!@_@@@ window.alert \"foo\" if 3>2 else if else if";
var fixture = new CoffeeScriptCompiler();

bool shouldDie = true;
bool shouldDie = false;

try {
var result = fixture.Compile(input);
Console.WriteLine(result);
if (result.StartsWith("ENGINE FAULT"))
shouldDie = true;
else Console.WriteLine(result);
} catch(Exception ex) {
Console.WriteLine("Ex: " + ex.Message);
shouldDie = false;
shouldDie = true;
}

Assert.False(shouldDie);
Assert.True(shouldDie);
}

[Fact]
Expand Down

0 comments on commit 0dfb3ee

Please sign in to comment.