Skip to content
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

[WIP] Update latex2unicode from 0.2.2 -> 0.2.4 #3781

Closed
wants to merge 2 commits into from

Conversation

LinusDietz
Copy link
Member

  • Investigate why this is failing
  • fix tests

@LinusDietz
Copy link
Member Author

So this is due to @tomtung fixing a feature we wished for long: tomtung/latex2unicode#8

tomtung/latex2unicode@6879cbb

@Siedlerchr
Copy link
Member

It maybe failing because we use our own replacement char as a workaround , I think. Not sure if it's this issue or another

@stefan-kolb
Copy link
Member

Looks like this is the case. The question is do we really want this behavior?

Failures (4):
  JUnit Jupiter:LatexToUnicodeFormatterTest:unknownCommandKeepsArgument()
    MethodSource [className = 'org.jabref.logic.layout.format.LatexToUnicodeFormatterTest', methodName = 'unknownCommandKeepsArgument', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: expected: <bbbb> but was: <\aaaabbbb>
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:52)
       org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:186)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:181)
       org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:486)
       org.jabref.logic.layout.format.LatexToUnicodeFormatterTest.unknownCommandKeepsArgument(LatexToUnicodeFormatterTest.java:118)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       [...]
  JUnit Jupiter:LatexToUnicodeFormatterTest:unknownCommandWithEmptyArgumentIsIgnored()
    MethodSource [className = 'org.jabref.logic.layout.format.LatexToUnicodeFormatterTest', methodName = 'unknownCommandWithEmptyArgumentIsIgnored', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: expected: <> but was: <\aaaa>
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:52)
       org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:186)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:181)
       org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:486)
       org.jabref.logic.layout.format.LatexToUnicodeFormatterTest.unknownCommandWithEmptyArgumentIsIgnored(LatexToUnicodeFormatterTest.java:123)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       [...]
  JUnit Jupiter:LatexToUnicodeFormatterTest:testFormatStripLatexCommands()
    MethodSource [className = 'org.jabref.logic.layout.format.LatexToUnicodeFormatterTest', methodName = 'testFormatStripLatexCommands', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: expected: <-> but was: <\mbox->
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:52)
       org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:186)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:181)
       org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:486)
       org.jabref.logic.layout.format.LatexToUnicodeFormatterTest.testFormatStripLatexCommands(LatexToUnicodeFormatterTest.java:25)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       [...]
  JUnit Jupiter:LatexToUnicodeFormatterTest:unknownCommandIsIgnored()
    MethodSource [className = 'org.jabref.logic.layout.format.LatexToUnicodeFormatterTest', methodName = 'unknownCommandIsIgnored', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: expected: <> but was: <\aaaa>
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:52)
       org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:186)
       org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:181)
       org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:486)
       org.jabref.logic.layout.format.LatexToUnicodeFormatterTest.unknownCommandIsIgnored(LatexToUnicodeFormatterTest.java:113)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       [...]

@stefan-kolb
Copy link
Member

stefan-kolb commented Feb 27, 2018

Currently the new update preserves the command \afor example, but strips the brackets like \a{hhh}->\ahhh.

@tomtung @JabRef/developers What about the behavior for these cases?
\aaaa{bbbb} currently gets \aaaabbbb
\aaaa{} currently gets \aaaa
Shouldn't the braces be preserved as well?

@stefan-kolb stefan-kolb added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Mar 1, 2018
@koppor
Copy link
Member

koppor commented Mar 30, 2018

+1 for preserving the braces

@LinusDietz
Copy link
Member Author

Devcall: We cannot update to 0.2.4 because this destroys valid latex code. Need to create a Pull Request at latex2Unicode.

@stefan-kolb
Copy link
Member

tomtung/latex2unicode#9

@stefan-kolb
Copy link
Member

We got an answer from Tom and need to discuss this. decision seems nontrivial to me.

@tobiasdiez
Copy link
Member

Whats the status here? If we want to upgrade to Java 9, we need to update the latex2unicode library, see #3421.

@koppor
Copy link
Member

koppor commented Dec 19, 2018 via email

@tobiasdiez
Copy link
Member

tomtung/latex2unicode#9 is now fixed. Updating the library leads some export test failures, which I have already fixed on the jdk9 branch. Thus, I've pushed the update there d54d6ff

@tobiasdiez tobiasdiez closed this Jun 3, 2019
@tobiasdiez tobiasdiez deleted the latex2unicode-0-2-4 branch June 3, 2019 20:20
@stefan-kolb
Copy link
Member

stefan-kolb commented Jun 3, 2019 via email

@LinusDietz LinusDietz removed the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants