mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
71c248a2e1
[rustdoc] If line number setting is disabled, do not make line numbers take space While working on https://github.com/rust-lang/rust/pull/150395, I realized that when enabled then disabled the "show line numbers" setting, instead of looking like initially: <img width="904" height="148" alt="Screenshot From 2025-12-26 16-51-44" src="https://github.com/user-attachments/assets/a24df2f2-61be-4db5-b60f-519b35425fd2" /> The "space" taken by line numbers was still there: <img width="904" height="148" alt="Screenshot From 2025-12-26 16-51-41" src="https://github.com/user-attachments/assets/b44af75d-52a4-4401-98e4-602b16bf6b9b" /> This PR fixes it. First commit cleans up the `utils.goml` file a bit, I think I'll do more cleanup because switching the settings without reloading the page should make GUI tests a bit faster. r? `@yotamofek`
The tests present here are used to test the generated HTML from rustdoc. The goal is to prevent unsound/unexpected GUI changes.
This is using the browser-ui-test framework to do so. It works as follows:
It wraps puppeteer to send commands to a web browser in order to navigate and test what's being currently displayed in the web page.
You can find more information and its documentation in its repository.
If you need to have more information on the tests run, you can use --test-args:
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --debug
If you don't want to run in headless mode (helpful to debug sometimes), you can use
--no-headless:
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless
To see the supported options, use --help.