1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(core): located_script_name macro was using format syntax (#18388)

This commit is contained in:
Matt Mastracci 2023-03-23 16:00:59 -06:00 committed by GitHub
parent ad77ba0f7b
commit edab8f2fd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,15 @@ pub mod _ops {
#[macro_export] #[macro_export]
macro_rules! located_script_name { macro_rules! located_script_name {
() => { () => {
concat!("[ext:{}:{}:{}]", std::file!(), std::line!(), std::column!()); concat!(
"[ext:",
std::file!(),
":",
std::line!(),
":",
std::column!(),
"]"
)
}; };
} }
@ -153,6 +161,13 @@ macro_rules! located_script_name {
mod tests { mod tests {
use super::*; 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] #[test]
fn test_v8_version() { fn test_v8_version() {
assert!(v8_version().len() > 3); assert!(v8_version().len() > 3);