Kaynağa Gözat

Add additional luhn test for fuller coverage as in #972 (#973)

* Add additional luhn test for fuller coverage as in #972

* Replace unnecessary test and add comment for future maintainers.

* Add link to issue #972 in Luhn tests

* Update luhn test formatting.
Sam Warner 8 yıl önce
ebeveyn
işleme
62b0414162

+ 6
- 1
exercises/luhn/src/test/java/LuhnValidatorTest.java Dosyayı Görüntüle

@@ -66,10 +66,15 @@ public class LuhnValidatorTest {
66 66
         assertFalse(luhnValidator.isValid("055-444-285"));
67 67
     }
68 68
 
69
+    /* The following test diverges from the canonical test data. This is because the corresponding canonical test does
70
+     * not account for Java specific functions (such as Character.getNumericValue()), which can be part of incorrect yet
71
+     * passing implementations. For more detail, check out issue #972 here:
72
+     * (https://github.com/exercism/java/issues/972).
73
+    */
69 74
     @Ignore("Remove to run test")
70 75
     @Test
71 76
     public void testThatStringContainingSymbolsIsInvalid() {
72
-        assertFalse(luhnValidator.isValid("055£ 444$ 285"));
77
+        assertFalse(luhnValidator.isValid("34&"));
73 78
     }
74 79
 
75 80
     @Ignore("Remove to run test")