mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 16:42:28 +03:00
20 lines
355 B
Rust
20 lines
355 B
Rust
use swc_common::{BytePos, Span, Spanned};
|
|
|
|
#[test]
|
|
fn lo_hi() {
|
|
#[derive(Spanned)]
|
|
struct LoHi {
|
|
#[span(lo)]
|
|
pub lo: BytePos,
|
|
#[span(hi)]
|
|
pub hi: BytePos,
|
|
}
|
|
|
|
let lo = BytePos(0);
|
|
let hi = BytePos(5);
|
|
assert_eq!(
|
|
LoHi { lo, hi }.span(),
|
|
Span::new(lo, hi, Default::default())
|
|
);
|
|
}
|