Bug 382169

Summary: syntax-highlighting-5.36.0 fails htmlhighlighter and folding tests
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Heiko Becker <heiko.becker>
Component: frameworkAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: asturm
Priority: NOR    
Version First Reported In: 5.36.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Heiko Becker 2017-07-09 18:32:18 UTC
syntax-highlighting fails two tests with 5.36.0. Qt version is 5.9.1.

6: PASS   : HTMLHighlighterTest::testHighlight(Makefile)
6: PASS   : HTMLHighlighterTest::testHighlight(light52_tb.vhdl)
6: PASS   : HTMLHighlighterTest::testHighlight(highlight.css)
6: --- /var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/syntax-highlighting-5.36.0/autotests/html/highlight.hs.html        2017-07-02 10:15:48.000000000 +0200
6: +++ /var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/build/autotests/html.output/highlight.hs.html      2017-07-09 16:22:41.677975831 +0200
6: @@ -128,4 +128,14 @@
6:  <span style="color:#898887;">-- data constructors</span>
6:  
6:  <span style="font-weight:bold;">EQ</span>, <span style="font-weight:bold;">False</span>, <span style="font-weight:bold;">GT</span>, <span style="font-weight:bold;">Just</span>, <span style="font-weight:bold;">LT</span>, <span style="font-weight:bold;">Left</span>, <span style="font-weight:bold;">Nothing</span>, <span style="font-weight:bold;">Right</span>, <span style="font-weight:bold;">True</span>
6: +
6: +<span style="color:#898887;">-- pragma with compiler flags</span>
6: +
6: +<span style="color:#006e28;">{-# OPTIONS_GHC -fno-warn-orphans #-}</span>
6: +
6: +<span style="color:#898887;">-- multiline pragma with language extensions</span>
6: +
6: +<span style="color:#006e28;">{-# LANGUAGE OverlappingInstances,</span>
6: +<span style="color:#006e28;">             BangPatterns</span>
6: +<span style="color:#006e28;">#-}</span>
6:  </pre></body></html>
6: FAIL!  : HTMLHighlighterTest::testHighlight(highlight.hs) Compared values are not the same
6:    Actual   (proc.exitCode()): 1
6:    Expected (0)              : 0
6:    Loc: [/var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/syntax-highlighting-5.36.0/autotests/htmlhighlighter_test.cpp(109)]


and

7: PASS   : FoldingTest::testFolding(highlight.exu)
7: PASS   : FoldingTest::testFolding(highlight.f90)
7: PASS   : FoldingTest::testFolding(highlight.glsl)
7: --- /var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/syntax-highlighting-5.36.0/autotests/folding/highlight.h
s.fold     2017-07-02 10:15:48.000000000 +0200
7: +++ /var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/build/autotests/folding.out/highlight.hs.fold      2017-
07-09 16:22:44.000989134 +0200
7: @@ -122,3 +122,13 @@
7:  -- data constructors
7:  
7:  EQ, False, GT, Just, LT, Left, Nothing, Right, True
7: +
7: +-- pragma with compiler flags
7: +
7: +{-# OPTIONS_GHC -fno-warn-orphans #-}
7: +
7: +-- multiline pragma with language extensions
7: +
7: +{-# LANGUAGE OverlappingInstances,
7: +             BangPatterns
7: +#-}
7: FAIL!  : FoldingTest::testFolding(highlight.hs) Compared values are not the same
7:    Actual   (proc.exitCode()): 1
7:    Expected (0)              : 0
7:    Loc: [/var/tmp/paludis/build/kde-frameworks-syntax-highlighting-5.36.0/work/syntax-highlighting-5.36.0/autotests/foldingtest.cp
p(180)]
7: PASS   : FoldingTest::testFolding(highlight.js)
Comment 1 Andreas Sturmlechner 2017-07-10 17:46:56 UTC
Same here with Qt 5.7.1
Comment 2 Dominik Haumann 2017-07-10 20:02:50 UTC
Git commit 7c861d948f766f9624a13d0ee7af03ba9d4cef48 by Dominik Haumann.
Committed on 10/07/2017 at 20:01.
Pushed by dhaumann into branch 'master'.

Haskell: fix unit tests

M  +10   -0    autotests/folding/highlight.hs.fold
M  +10   -0    autotests/html/highlight.hs.html
M  +2    -2    autotests/reference/highlight.hs.ref
M  +99   -99   data/syntax/haskell.xml

https://commits.kde.org/syntax-highlighting/7c861d948f766f9624a13d0ee7af03ba9d4cef48
Comment 3 Dominik Haumann 2017-07-10 20:16:49 UTC
This is fixed now (with yet another commit). The bad news is that, since KF 5.36 is released, this test regression is released.

The good news is that it was just the unit test reference that was wrong, so the code itself is correct, so we don't have any bug here.

Thanks for reporting, it seems we did a bad job not noticing the failing test for 2 weeks!