Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip redirect if no entry to redirect to #1704

Merged
merged 3 commits into from
Sep 25, 2021

Conversation

ericphanson
Copy link
Contributor

@ericphanson ericphanson commented Sep 25, 2021

Fix #1693

untested..

@ericphanson
Copy link
Contributor Author

Added a test and checked that it failed on master:

julia> include("test/htmlwriter.jl")
WARNING: replacing module HTMLWriterTests.
HTMLWriter: Error During Test at /Users/eph/.julia/dev/Documenter/test/htmlwriter.jl:26
  Got exception outside of a @test
  BoundsError: attempt to access 0-element Vector{String} at index [1]
  Stacktrace:
    [1] getindex
      @ ./array.jl:835 [inlined]
    [2] first
      @ ./abstractarray.jl:398 [inlined]
    [3] #261
      @ ~/.julia/dev/Documenter/src/Writers/HTMLWriter.jl:1423 [inlined]
    [4] open(::Documenter.Writers.HTMLWriter.var"#261#262"{Vector{String}, String}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
      @ Base ./io.jl:330
    [5] open
      @ ./io.jl:328 [inlined]
    [6] generate_redirect_file(redirectfile::String, entries::Vector{String})
      @ Documenter.Writers.HTMLWriter ~/.julia/dev/Documenter/src/Writers/HTMLWriter.jl:1421
    [7] (::Main.HTMLWriterTests.var"#3#10")(tmpdir::String)
      @ Main.HTMLWriterTests ~/.julia/dev/Documenter/test/htmlwriter.jl:247
    [8] mktempdir(fn::Main.HTMLWriterTests.var"#3#10", parent::String; prefix::String)
      @ Base.Filesystem ./file.jl:750
    [9] mktempdir(fn::Function, parent::String) (repeats 2 times)
      @ Base.Filesystem ./file.jl:748
   [10] macro expansion
      @ ~/.julia/dev/Documenter/test/htmlwriter.jl:152 [inlined]
   [11] macro expansion
      @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1282 [inlined]
   [12] top-level scope
      @ ~/.julia/dev/Documenter/test/htmlwriter.jl:27
   [13] include(fname::String)
      @ Base.MainInclude ./client.jl:451
   [14] top-level scope
      @ REPL[3]:1
   [15] eval
      @ ./boot.jl:373 [inlined]
   [16] eval_user_input(ast::Any, backend::REPL.REPLBackend)
      @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
   [17] repl_backend_loop(backend::REPL.REPLBackend)
      @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:241
   [18] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
      @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:226
   [19] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
      @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:359
   [20] run_repl(repl::REPL.AbstractREPL, consumer::Any)
      @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:346
   [21] (::Base.var"#929#931"{Bool, Bool, Bool})(REPL::Module)
      @ Base ./client.jl:394
   [22] #invokelatest#2
      @ ./essentials.jl:716 [inlined]
   [23] invokelatest
      @ ./essentials.jl:714 [inlined]
   [24] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
      @ Base ./client.jl:379
   [25] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:309
   [26] _start()
      @ Base ./client.jl:495
Test Summary: | Pass  Error  Total
HTMLWriter    |  130      1    131
ERROR: LoadError: Some tests did not pass: 130 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/eph/.julia/dev/Documenter/test/htmlwriter.jl:1

@fredrikekre fredrikekre merged commit d01a54c into JuliaDocs:master Sep 25, 2021
@ericphanson ericphanson deleted the patch-1 branch September 25, 2021 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deploydocs throws if you are on the first PR setting up docs
3 participants