Просмотр исходного кода

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 лет назад
Родитель
Сommit
62b0414162
1 измененных файлов: 6 добавлений и 1 удалений
  1. 6
    1
      exercises/luhn/src/test/java/LuhnValidatorTest.java

+ 6
- 1
exercises/luhn/src/test/java/LuhnValidatorTest.java Просмотреть файл

66
         assertFalse(luhnValidator.isValid("055-444-285"));
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
     @Ignore("Remove to run test")
74
     @Ignore("Remove to run test")
70
     @Test
75
     @Test
71
     public void testThatStringContainingSymbolsIsInvalid() {
76
     public void testThatStringContainingSymbolsIsInvalid() {
72
-        assertFalse(luhnValidator.isValid("055£ 444$ 285"));
77
+        assertFalse(luhnValidator.isValid("34&"));
73
     }
78
     }
74
 
79
 
75
     @Ignore("Remove to run test")
80
     @Ignore("Remove to run test")