diff options
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 17 |
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); } |