Commit f320f3b2 authored by Vladislav Zavialov's avatar Vladislav Zavialov

Fix the ghci063 test on Darwin (Trac #16201)

We use "touch -r" to set modification timestamps, which leads to precision loss
on Darwin. For example,

   before: 2019-02-25 01:11:23.807627350 +0300
   after:  2019-02-25 01:11:23.807627000 +0300
                                     ^^^
This means we can't trick GHCi into thinking the file hasn't been changed by
restoring its old timestamp, as we cannot faithfully restore all digits.

The solution is to nullify the insignificant digits before the first :load
parent 14586f5d
......@@ -104,7 +104,7 @@ test('ghci061', normal, ghci_script, ['ghci061.script'])
test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']),
when(config.have_ext_interp, extra_ways(['ghci-ext']))],
ghci_script, ['ghci062.script'])
test('ghci063', when(opsys('darwin'), expect_broken(16201)), ghci_script, ['ghci063.script'])
test('ghci063', normal, ghci_script, ['ghci063.script'])
test('T2452', [extra_hc_opts("-fno-implicit-import-qualified")],
ghci_script, ['T2452.script'])
......
:! echo module A where {} >A.hs
:! echo module B where { import A } >B.hs
-- Workaround for Trac #16201. We use "touch -r" to set modification
-- timestamps, which leads to precision loss on Darwin. For example,
--
-- before: 2019-02-25 01:11:23.807627350 +0300
-- after: 2019-02-25 01:11:23.807627000 +0300
-- ^^^
-- This means we can't trick GHCi into thinking the file hasn't been changed
-- by restoring its old timestamp, as we cannot faithfully restore all digits.
--
-- The solution is to nullify the insignificant digits before the first load.
:! touch -r B.hs B.hs
:load B
-- We're going to replace B.hs with an invalid module but without
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment