From 32500aa8e0f23029c0fa69235d19f770106c016f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 14 Nov 2024 11:08:06 -0700 Subject: rustdoc-search: case-sensitive only when capitals are used This is the "smartcase" behavior, described by vim and dtolnay. --- tests/rustdoc-js/case.js | 17 +++++++++++++++++ tests/rustdoc-js/case.rs | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/rustdoc-js/case.js create mode 100644 tests/rustdoc-js/case.rs (limited to 'tests/rustdoc-js') diff --git a/tests/rustdoc-js/case.js b/tests/rustdoc-js/case.js new file mode 100644 index 00000000000..22b970eb139 --- /dev/null +++ b/tests/rustdoc-js/case.js @@ -0,0 +1,17 @@ +const EXPECTED = [ + { + 'query': 'Foo', + 'others': [ + { 'path': 'case', 'name': 'Foo', 'desc': 'Docs for Foo' }, + { 'path': 'case', 'name': 'foo', 'desc': 'Docs for foo' }, + ], + }, + { + 'query': 'foo', + 'others': [ + // https://github.com/rust-lang/rust/issues/133017 + { 'path': 'case', 'name': 'Foo', 'desc': 'Docs for Foo' }, + { 'path': 'case', 'name': 'foo', 'desc': 'Docs for foo' }, + ], + }, +]; diff --git a/tests/rustdoc-js/case.rs b/tests/rustdoc-js/case.rs new file mode 100644 index 00000000000..532edd55f1d --- /dev/null +++ b/tests/rustdoc-js/case.rs @@ -0,0 +1,7 @@ +#![allow(nonstandard_style)] + +/// Docs for Foo +pub struct Foo; + +/// Docs for foo +pub struct foo; -- cgit 1.4.1-3-g733a5