From bb9c60d90863b21a0e981f00e354d02b0e9fb584 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 17 Dec 2019 21:43:19 +0800 Subject: Use substr instead of endswith --- editors/code/src/test/utils/diagnotics/rust.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'editors') diff --git a/editors/code/src/test/utils/diagnotics/rust.test.ts b/editors/code/src/test/utils/diagnotics/rust.test.ts index 9acd319b3..358325cc8 100644 --- a/editors/code/src/test/utils/diagnotics/rust.test.ts +++ b/editors/code/src/test/utils/diagnotics/rust.test.ts @@ -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', ); }); }); -- cgit v1.2.3