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

Fix (more) test directives that were accidentally ignored #137540

Merged
merged 2 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Scraped example should only include line numbers for items b and c in ex.rs
// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '14'
// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '15'
// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '21'
// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '22'
//@ !has foobar/fn.f.html '//span[@data-nosnippet]' '14'
//@ has foobar/fn.f.html '//span[@data-nosnippet]' '15'
//@ has foobar/fn.f.html '//span[@data-nosnippet]' '21'
//@ !has foobar/fn.f.html '//span[@data-nosnippet]' '22'

pub fn f() {}

Expand Down
7 changes: 3 additions & 4 deletions tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//*[@class="prev"]' ''
// @has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeGomez IIUC, this specific directive, checking for the a prev button, was broken by #129796 , and is no longer needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prev button is generated by the JS, so it cannot be checked here indeed.

// @has src/ex/ex.rs.html
// @has foobar/fn.ok.html '//a[@href="../src/ex/ex.rs.html#2"]' ''
//@ has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' ''
//@ has src/ex/ex.rs.html
//@ has foobar/fn.ok.html '//a[@href="../src/ex/ex.rs.html#2"]' ''

pub fn ok() {}
8 changes: 4 additions & 4 deletions tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' 'ex2'
// @has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' 'ex1'
// @has foobar/fn.ok.html '//*[@class="highlight focus"]' 'ok'
// @has foobar/fn.ok.html '//*[@class="highlight"]' 'ok'
//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' 'ex2'
//@ has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' 'ex1'
//@ has foobar/fn.ok.html '//*[@class="highlight focus"]' 'ok'
//@ has foobar/fn.ok.html '//*[@class="highlight"]' 'ok'

pub fn ok(_x: i32) {}
4 changes: 2 additions & 2 deletions tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @has foobar/b/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
// @has foobar/c/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
//@ has foobar/b/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
//@ has foobar/c/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'

#[path = "a.rs"]
pub mod b;
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-scrape-examples-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' ''
//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' ''

pub fn ok() {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' ' '
//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' ' '

pub fn ok() {}
6 changes: 3 additions & 3 deletions tests/run-make/rustdoc-themes/foo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @has test.css
// @has foo/struct.Foo.html
// @has - '//*[@name="rustdoc-vars"]/@data-themes' 'test'
//@ has test.css
//@ has foo/struct.Foo.html
//@ has - '//*[@name="rustdoc-vars"]/@data-themes' 'test'
pub struct Foo;
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-with-out-dir-option/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @has foobar/fn.ok.html
//@ has foobar/fn.ok.html
pub fn ok() {}
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-with-output-option/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @has foobar/fn.ok.html
//@ has foobar/fn.ok.html
pub fn ok() {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @has foobar/fn.ok.html
//@ has foobar/fn.ok.html
pub fn ok() {}
3 changes: 0 additions & 3 deletions tests/rustdoc-ui/unused-extern-crate.rs

This file was deleted.

2 changes: 2 additions & 0 deletions tests/rustdoc/unused-extern-crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//@ aux-crate:panic_item=panic-item.rs
//@ has unused_extern_crate/index.html
2 changes: 1 addition & 1 deletion tests/ui/inline-const/collect-scopes-in-pat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compile-flags: -Zlint-mir
//@ compile-flags: -Zlint-mir
//@ check-pass

#![feature(inline_const_pat)]
Expand Down
Loading