From 61ddf2dc5d9c4f1ebd10759f2962b75d6a2ee316 Mon Sep 17 00:00:00 2001 From: Takuto Asakura Date: Sat, 10 Aug 2024 22:42:37 +0900 Subject: [PATCH] attempt to fix ci on windows --- script/texdoclib-search.tlu | 2 +- spec/search/texdocs_spec.rb | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/script/texdoclib-search.tlu b/script/texdoclib-search.tlu index b44eeb5..b0e8235 100644 --- a/script/texdoclib-search.tlu +++ b/script/texdoclib-search.tlu @@ -383,7 +383,7 @@ init_texdocs_database = function() local root, shift = lsr_root(path) if root and shift and recursion_allowed then dbg_print('texdocs', - 'texdocs[%d] using index: %s (shift=%s)', i, w32_path(root), shift) + 'texdocs[%d] using index: %s (shift=%s)', i, w32_path(root), w32_path(shift)) db = init_lsr_db(root, shift) elseif not index_mandatory and lfs.isdir(path) then dbg_print('texdocs', diff --git a/spec/search/texdocs_spec.rb b/spec/search/texdocs_spec.rb index 9d8ea11..8f514c3 100644 --- a/spec/search/texdocs_spec.rb +++ b/spec/search/texdocs_spec.rb @@ -11,19 +11,21 @@ } before(:each) { run_texdoc "-dtexdocs", "listings" } + let(:tree_prefix) { normalize_path("path/to/") } + it "should be properly interpreted" do expect(stderr).to include( debug_line "texdocs", - "texdocs[4] = path/to/tree4 (index_mandatory=false, recursion_allowed=false)") + "texdocs[4] = #{tree_prefix}tree4 (index_mandatory=false, recursion_allowed=false)") expect(stderr).to include( debug_line "texdocs", - "texdocs[3] = path/to/tree3 (index_mandatory=false, recursion_allowed=true)") + "texdocs[3] = #{tree_prefix}tree3 (index_mandatory=false, recursion_allowed=true)") expect(stderr).to include( debug_line "texdocs", - "texdocs[2] = path/to/tree2 (index_mandatory=true, recursion_allowed=false)") + "texdocs[2] = #{tree_prefix}tree2 (index_mandatory=true, recursion_allowed=false)") expect(stderr).to include( debug_line "texdocs", - "texdocs[1] = path/to/tree1 (index_mandatory=true, recursion_allowed=true)") + "texdocs[1] = #{tree_prefix}tree1 (index_mandatory=true, recursion_allowed=true)") end end @@ -33,15 +35,19 @@ let(:texmf_dist_regex) { Regexp.escape(normalize_path(`kpsewhich -var-value TEXMFDIST`.chomp)) } let(:texmf_home_regex) { Regexp.escape(normalize_path(texmf_home)) } + let(:path_doc_suffix_regex) { Regexp.escape(normalize_path("/doc")) } + let(:shift_doc_suffix_regex) { Regexp.escape(normalize_path("doc/")) } + let(:texdocs_n_dist) { - /texdocs\[(\d+?)\] = #{texmf_dist_regex}\/doc/.match(stderr).to_a.values_at(1)[0].to_i + /texdocs\[(\d+?)\] = #{texmf_dist_regex}#{path_doc_suffix_regex}/.match(stderr).to_a.values_at(1)[0].to_i } let(:texdocs_n_home) { - /texdocs\[(\d+?)\] = #{texmf_home_regex}\/doc/.match(stderr).to_a.values_at(1)[0].to_i + /texdocs\[(\d+?)\] = #{texmf_home_regex}#{path_doc_suffix_regex}/.match(stderr).to_a.values_at(1)[0].to_i } it "should search TEXMFDIST using index" do - expect(stderr).to match(/texdocs\[#{texdocs_n_dist}\] using index: #{texmf_dist_regex} \(shift=doc\/\)/) + expect(stderr).to match( + /texdocs\[#{texdocs_n_dist}\] using index: #{texmf_dist_regex} \(shift=#{shift_doc_suffix_regex}\)/) end it "should search TEXMFHOME using file system" do