mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Use substr instead of endswith
This commit is contained in:
parent
63c59308e6
commit
bb9c60d908
1 changed files with 3 additions and 3 deletions
|
@ -212,7 +212,7 @@ describe('mapRustDiagnosticToVsCode', () => {
|
|||
assert.strictEqual(
|
||||
diagnostic.message,
|
||||
[
|
||||
'can\'t compare `{integer}` with `&str`',
|
||||
"can't compare `{integer}` with `&str`",
|
||||
'the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`',
|
||||
].join('\n'),
|
||||
);
|
||||
|
@ -229,8 +229,8 @@ describe('mapRustDiagnosticToVsCode', () => {
|
|||
// The file url should be normal file
|
||||
// Ignore the first part because it depends on vs workspace location
|
||||
assert.strictEqual(
|
||||
true,
|
||||
location.uri.toString().endsWith('src/main.rs'),
|
||||
location.uri.path.substr(-'src/main.rs'.length),
|
||||
'src/main.rs',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue