summaryrefslogtreecommitdiff
blob: f2742f658fa2c5363b26b3996a7df38880d75a10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/src/test/java/org/yaml/snakeyaml/issues/issue377/BillionLaughsAttackTest.java
+++ b/src/test/java/org/yaml/snakeyaml/issues/issue377/BillionLaughsAttackTest.java
@@ -69,7 +69,7 @@ public class BillionLaughsAttackTest {
             map.toString();
             fail("Expected overflow");
         } catch (Throwable e) {
-            assertTrue(e.getMessage().contains("heap"));
+            assertTrue("Catched exception " + e + " is not an instance of OutOfMemoryError", e instanceof OutOfMemoryError);
         }
     }
 
@@ -94,4 +94,4 @@ public class BillionLaughsAttackTest {
         assertNotNull(map);
     }
     
-}
\ No newline at end of file
+}