summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-03-23 16:00:59 -0600
committerGitHub <noreply@github.com>2023-03-23 16:00:59 -0600
commitedab8f2fd48efddc19eb0032955fee4b5dbf76e6 (patch)
treef3c395f378c70f8a75e2fdbeb3f5340f814d9a70 /core
parentad77ba0f7b40760e04b79d9789da16d7c49010b8 (diff)
fix(core): located_script_name macro was using format syntax (#18388)
Diffstat (limited to 'core')
-rw-r--r--core/lib.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/lib.rs b/core/lib.rs
index ba0a026bc..3f4cdd2e0 100644
--- a/core/lib.rs
+++ b/core/lib.rs
@@ -145,7 +145,15 @@ pub mod _ops {
#[macro_export]
macro_rules! located_script_name {
() => {
- concat!("[ext:{}:{}:{}]", std::file!(), std::line!(), std::column!());
+ concat!(
+ "[ext:",
+ std::file!(),
+ ":",
+ std::line!(),
+ ":",
+ std::column!(),
+ "]"
+ )
};
}
@@ -154,6 +162,13 @@ mod tests {
use super::*;
#[test]
+ 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:"));
+ }
+
+ #[test]
fn test_v8_version() {
assert!(v8_version().len() > 3);
}