-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Tests of BibEntry and BibDatabase #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| public void resolveStrings() throws IOException { | ||
| try (FileReader fr = new FileReader("src/test/resources/net/sf/jabref/util/twente.bib")) { | ||
| try (FileInputStream stream = new FileInputStream("src/test/resources/net/sf/jabref/util/twente.bib"); | ||
| InputStreamReader fr = new InputStreamReader(stream, StandardCharsets.ISO_8859_1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the StandardCharset really ISO and not UTF of that file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now that the encoding is stated as UTF in the file. However since ISO is the first code page of UTF it is hard to actually determine the difference here... (And if I'm not wrong US_ASCII would also have worked for this file...)
I'll change it if there are other things to change as it is working and is sort of correct.
|
I've fixed all(?) comments. One thing happened though. What is the difference between the two BibEntry under test here? (The test shouldn't look like this, but I kept both for now.) @Test
@Ignore
public void getFieldOrAliasDateWithYearNumericalMonth() {
Assert.assertEquals("2003-03",
(BibtexParser.singleFromString("@ARTICLE{HipKro03, year = {2003}, month = 3 }")).getFieldOrAlias("date"));
emptyEntry.setField("year", "2003");
emptyEntry.setField("month", "#3#");
Assert.assertEquals("2003-03", emptyEntry.getFieldOrAlias("date"));
}The first assertion passes, but not the second. Seems to be something with the parser? |
|
What happens if you remove the # in the month field? |
|
Then it works, but that is a different test case. (I was surprised that the original test case worked, I only saw it in another test a few lines above.) |
|
I have the other test case |
|
But |
|
Maybe there isn't a problem. However, if the corresponding statement was in
a .bib-file it would apparently be parsed as 3 and not #3# .
I remove that test then.
|
Added more tests and fixed a few issues.
Fixed(?) a Coverity issue in AboutDialog.