()
| 826 | #[test] |
| 827 | #[cfg(feature = "bumpalo")] |
| 828 | fn test_bumpalo_compatibility() { |
| 829 | use bumpalo::Bump; |
| 830 | |
| 831 | // Test that Bumpalo's Bump can be used as an allocator |
| 832 | let bump = Bump::new(); |
| 833 | let c = Cursor::new(SourceOffset(0), Token::new_ident(true, false, false, 0, 3)); |
| 834 | |
| 835 | // Test that the old interface still works |
| 836 | assert_eq!(SourceCursor::from(c, "FoO").parse(&bump), "FoO"); |
| 837 | assert_eq!(SourceCursor::from(c, "FoO").parse_ascii_lower(&bump), "foo"); |
| 838 | |
| 839 | // Test that the new interface works with Bumpalo too |
| 840 | assert_eq!(&*SourceCursor::from(c, "FoO").parse(&bump), "FoO"); |
| 841 | assert_eq!(&*SourceCursor::from(c, "FoO").parse_ascii_lower(&bump), "foo"); |
| 842 | |
| 843 | // Test with escape sequences |
| 844 | let c = Cursor::new(SourceOffset(0), Token::new_ident(false, false, true, 0, 7)); |
| 845 | assert_eq!(SourceCursor::from(c, "b\\61\\72").parse(&bump), "bar"); |
| 846 | assert_eq!(&*SourceCursor::from(c, "b\\61\\72").parse(&bump), "bar"); |
| 847 | } |
| 848 | |
| 849 | #[test] |
| 850 | fn test_compact_ident_with_escapes() { |
nothing calls this directly
no test coverage detected