Skip to content

Conversation

@oscargus
Copy link
Contributor

Added more tests and fixed a few issues.

Fixed(?) a Coverity issue in AboutDialog.

@oscargus oscargus added [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs testing status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Mar 25, 2016
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)) {
Copy link
Member

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?

Copy link
Contributor Author

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.

@oscargus
Copy link
Contributor Author

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?

@tobiasdiez
Copy link
Member

What happens if you remove the # in the month field?

@oscargus
Copy link
Contributor Author

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.)

@oscargus
Copy link
Contributor Author

I have the other test case getFieldOrAliasDateWithYearNumericalMonthString

@tobiasdiez
Copy link
Member

But #3# is not a valid month format, or is it? as getFieldOrAliasDateWithYearAbbreviatedMonth works, I don't see a problem here.

@oscargus
Copy link
Contributor Author

oscargus commented Mar 25, 2016 via email

@oscargus oscargus merged commit 6516301 into JabRef:master Mar 25, 2016
@oscargus oscargus deleted the keywordtests branch March 25, 2016 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[outdated] type: bug Confirmed bugs or reports that are very likely to be bugs status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants