Skip to content

Commit

Permalink
attempt to fix ci on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wtsnjp committed Aug 10, 2024
1 parent 9a6c868 commit 61ddf2d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion script/texdoclib-search.tlu
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
20 changes: 13 additions & 7 deletions spec/search/texdocs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 61ddf2d

Please sign in to comment.