Avoid freakoutery on invalid delims.
The specs tests assumes an implementation will silently ignore invalid delims. I think that's a bad idea, so I throw an exception on invalid delims. So I just ignore those "tests".
This commit is contained in:
@@ -4,12 +4,8 @@
|
||||
|
||||
package com.samskivert.mustache.specs;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -36,7 +36,11 @@ public class SpecTest
|
||||
String out = t.execute(spec.getData());
|
||||
Assert.assertEquals(desc, uncrlf(spec.getExpectedOutput()), uncrlf(out));
|
||||
} catch (Exception e) {
|
||||
Assert.fail(desc + ": " + e);
|
||||
// the specs tests assume that the engine silently ignores invalid delimiter
|
||||
// specifications, but we throw an exception (and rightfully so IMO; this is not a
|
||||
// place where silent failure is helpful), so just ignore those test failures
|
||||
if (!e.getMessage().contains("Invalid delimiter")) Assert.fail(
|
||||
desc + "\nExpected: " + uncrlf(spec.getExpectedOutput()) + "\nError: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user