]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/span-absolute-posititions.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / proc-macro / span-absolute-posititions.rs
1 // aux-build:assert-span-pos.rs
2 // ignore-tidy-tab
3 extern crate assert_span_pos;
4
5 assert_span_pos::assert_span_pos!(5, 35);
6
7 // Test space indentation
8     assert_span_pos::assert_span_pos!(8, 39);
9 // Test tab indentation
10         assert_span_pos::assert_span_pos!(10, 36);
11
12 // Two tests to ensure the promise of the docs that the column is the number
13 // of UTF-8 bytes instead of some other number like number of code points.
14
15 // Test that multi byte UTF-8 characters indeed count as multiple bytes
16 /*🌈*/assert_span_pos::assert_span_pos!(16, 40);
17 // Test with a complete grapheme cluster
18 /*🏳️‍🌈*/assert_span_pos::assert_span_pos!(18, 43);
19
20 // Test that the macro actually emits an error on a mismatch:
21 assert_span_pos::assert_span_pos!(0, 35); //~ ERROR line/column mismatch: (0, 35) != (21, 35)
22 assert_span_pos::assert_span_pos!(22, 0); //~ ERROR line/column mismatch: (22, 0) != (22, 35)
23
24 fn main() {}