mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(core): located_script_name macro was using format syntax (#18388)
This commit is contained in:
parent
ad77ba0f7b
commit
edab8f2fd4
1 changed files with 16 additions and 1 deletions
17
core/lib.rs
17
core/lib.rs
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue