1
Fork 0

rustdoc-search: case-sensitive only when capitals are used

This is the "smartcase" behavior, described by vim and dtolnay.
This commit is contained in:
Michael Howell 2024-11-14 11:08:06 -07:00
parent a4cedecc9e
commit 32500aa8e0
4 changed files with 55 additions and 4 deletions

17
tests/rustdoc-js/case.js Normal file
View file

@ -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' },
],
},
];