From dbf9d117a12985c66861cf763b99705bc239386f Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 6 Nov 2024 12:39:48 -0500 Subject: [PATCH] Another flailing attempt to get deterministic assertions in a test case. --- spec/infoview/contents_spec.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/infoview/contents_spec.lua b/spec/infoview/contents_spec.lua index e0de1d6d..5915e8be 100644 --- a/spec/infoview/contents_spec.lua +++ b/spec/infoview/contents_spec.lua @@ -424,9 +424,15 @@ describe('interactive infoview', function() it( 'shows diagnostics for files with immediate diagnostics', helpers.clean_buffer('import DoesNotExist', function() + -- FIXME: This is a bug in `wait_for_loading_pins` (which is already + -- something isn't waiting properly, and nondeterministically we don't + -- end up with the right contents in tests :/ + helpers.wait_for_loading_pins() + vim.wait(10000, function() + return not vim.deep_equal(require('lean.infoview').get_current_infoview():get_lines(), {}) + end) -- the output in this case has the search path in it, so just match a -- bit of our expected contents - helpers.wait_for_loading_pins() assert.are.same( [[unknown module prefix 'DoesNotExist']], require('lean.infoview').get_current_infoview():get_line(1)