mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Use substr instead of endswith
This commit is contained in:
parent
63c59308e6
commit
bb9c60d908
@ -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 New Issue
Block a user