mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
11d056c777
Move FromVariant to a separate crate
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())
|
|
);
|
|
}
|