simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
2.91k stars 315 forks source link

roi test failing #937

Closed simonmichael closed 5 years ago

simonmichael commented 5 years ago

Something has happened to cause roi functional test failures:

$ make functest
...
:tests/misc/roi.test:4: [Failed]
Command (at line 104):
/Users/simon/src/PLAINTEXTACCOUNTING/hledger/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/hledger  -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
Expected stdout: 
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
|   ||      Begin |        End || Value (begin) | Cashflow | Value (end) | PnL ||    IRR |    TWR |
+===++============+============++===============+==========+=============+=====++========+========+
| 1 || 2017/01/01 | 2017/12/31 ||             0 |      200 |         220 |  20 || 12.73% | 10.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
...(1 more)
Got stdout:      
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
|   ||      Begin |        End || Value (begin) | Cashflow | Value (end) | PnL ||    IRR |    TWR |
+===++============+============++===============+==========+=============+=====++========+========+
| 1 || 2017/01/01 | 2017/12/31 ||             0 |      200 |         220 |  20 || 12.72% | 10.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
...(1 more)
:tests/misc/roi.test:6: [Failed]
Command (at line 150):
/Users/simon/src/PLAINTEXTACCOUNTING/hledger/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/hledger  -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Q
Expected stdout: 
+---++------------+------------++---------------+----------+-------------+-----++---------+---------+
|   ||      Begin |        End || Value (begin) | Cashflow | Value (end) | PnL ||     IRR |     TWR |
+===++============+============++===============+==========+=============+=====++=========+=========+
| 1 || 2017/01/01 | 2017/03/31 ||             0 |      100 |         100 |   0 ||   0.00% |   0.00% |
| 2 || 2017/04/01 | 2017/06/30 ||           100 |        0 |         110 |  10 ||  46.56% | ...(317 more)
Got stdout:      
+---++------------+------------++---------------+----------+-------------+-----++---------+---------+
|   ||      Begin |        End || Value (begin) | Cashflow | Value (end) | PnL ||     IRR |     TWR |
+===++============+============++===============+==========+=============+=====++=========+=========+
| 1 || 2017/01/01 | 2017/03/31 ||             0 |      100 |         100 |   0 ||  -0.00% |   0.00% |
| 2 || 2017/04/01 | 2017/06/30 ||           100 |        0 |         110 |  10 ||  46.56% | ...(317 more)

         Test Cases    Total        
 Passed  425           425          
 Failed  2             2            
 Total   427           427          
functest FAILED
make: *** [functest] Error 1
adept commented 5 years ago

At a glance, looks like rounding caused by "statistics" update (unless there are more sinister differences concealed under "... more" lines). I would be able to take a closer look later in Jan.