File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
main/java/fr/abes/sudoc/service
test/java/fr/abes/sudoc/service Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public IsbnService(BaseXmlFunctionsCaller caller) {
21
21
22
22
@ Override
23
23
public boolean checkFormat (String isbn ) {
24
- return isbn != null && isbn .matches ("^[0-9]((?:-?[0-9]){9}|(?:-?[0-9]){12})$" );
24
+ return isbn != null && isbn .matches ("^[0-9]((?:-?[0-9]){9}|(?:-?[0-9]){8}X|(?:-?[0-9]){ 12})$" );
25
25
}
26
26
27
27
@ Override
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ void checkFormatIsbn10Characters() {
58
58
59
59
String isbn6 = "-22225-555---3--1" ;
60
60
Assertions .assertFalse (isbnService .checkFormat (isbn6 ));
61
+
62
+ String isbn7 = "274758450X" ;
63
+ Assertions .assertTrue (isbnService .checkFormat (isbn7 ));
61
64
}
62
65
63
66
@ Test
You can’t perform that action at this time.
0 commit comments