diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-03-24 12:00:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-24 16:00:47 +0000 |
commit | de4667febee41284ceddb873d27d7e6cf65a66ff (patch) | |
tree | 2e82292c44a1a2d0351aefcc323f7b346f7ead2f /core/lib.rs | |
parent | 675179a176add68dcd72f386b343c3dba1fe71fe (diff) |
chore: fix located_script_name test (#18418)
Closes #18417
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/lib.rs b/core/lib.rs index 3f4cdd2e0..e8ca36559 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -165,7 +165,13 @@ mod tests { fn located_script_name() { // Note that this test will fail if this file is moved. We don't // test line locations because that's just too brittle. - assert!(located_script_name!().starts_with("[ext:core/lib.rs:")); + let name = located_script_name!(); + let expected = if cfg!(windows) { + "[ext:core\\lib.rs:" + } else { + "[ext:core/lib.rs:" + }; + assert_eq!(&name[..expected.len()], expected); } #[test] |