@@ -47,71 +47,3 @@ mod util {
47
47
pub use util:: * ;
48
48
pub use interface:: { ExpandedName , QualName , Attribute } ;
49
49
pub use util:: smallcharset:: SmallCharSet ;
50
-
51
-
52
-
53
- #[ cfg( test) ]
54
- #[ allow( non_snake_case) ]
55
- mod test {
56
- use tendril:: SliceExt ;
57
-
58
- use super :: util:: buffer_queue:: { BufferQueue , FromSet , NotFromSet } ;
59
-
60
- #[ test]
61
- fn smoke_test ( ) {
62
- let mut bq = BufferQueue :: new ( ) ;
63
- assert_eq ! ( bq. peek( ) , None ) ;
64
- assert_eq ! ( bq. next( ) , None ) ;
65
-
66
- bq. push_back ( "abc" . to_tendril ( ) ) ;
67
- assert_eq ! ( bq. peek( ) , Some ( 'a' ) ) ;
68
- assert_eq ! ( bq. next( ) , Some ( 'a' ) ) ;
69
- assert_eq ! ( bq. peek( ) , Some ( 'b' ) ) ;
70
- assert_eq ! ( bq. peek( ) , Some ( 'b' ) ) ;
71
- assert_eq ! ( bq. next( ) , Some ( 'b' ) ) ;
72
- assert_eq ! ( bq. peek( ) , Some ( 'c' ) ) ;
73
- assert_eq ! ( bq. next( ) , Some ( 'c' ) ) ;
74
- assert_eq ! ( bq. peek( ) , None ) ;
75
- assert_eq ! ( bq. next( ) , None ) ;
76
- }
77
-
78
- #[ test]
79
- fn can_unconsume ( ) {
80
- let mut bq = BufferQueue :: new ( ) ;
81
- bq. push_back ( "abc" . to_tendril ( ) ) ;
82
- assert_eq ! ( bq. next( ) , Some ( 'a' ) ) ;
83
-
84
- bq. push_front ( "xy" . to_tendril ( ) ) ;
85
- assert_eq ! ( bq. next( ) , Some ( 'x' ) ) ;
86
- assert_eq ! ( bq. next( ) , Some ( 'y' ) ) ;
87
- assert_eq ! ( bq. next( ) , Some ( 'b' ) ) ;
88
- assert_eq ! ( bq. next( ) , Some ( 'c' ) ) ;
89
- assert_eq ! ( bq. next( ) , None ) ;
90
- }
91
-
92
- #[ test]
93
- fn can_pop_except_set ( ) {
94
- let mut bq = BufferQueue :: new ( ) ;
95
- bq. push_back ( "abc&def" . to_tendril ( ) ) ;
96
- let mut pop = || bq. pop_except_from ( small_char_set ! ( '&' ) ) ;
97
- assert_eq ! ( pop( ) , Some ( NotFromSet ( "abc" . to_tendril( ) ) ) ) ;
98
- assert_eq ! ( pop( ) , Some ( FromSet ( '&' ) ) ) ;
99
- assert_eq ! ( pop( ) , Some ( NotFromSet ( "def" . to_tendril( ) ) ) ) ;
100
- assert_eq ! ( pop( ) , None ) ;
101
- }
102
-
103
- #[ test]
104
- fn can_eat ( ) {
105
- // This is not very comprehensive. We rely on the tokenizer
106
- // integration tests for more thorough testing with many
107
- // different input buffer splits.
108
- let mut bq = BufferQueue :: new ( ) ;
109
- bq. push_back ( "a" . to_tendril ( ) ) ;
110
- bq. push_back ( "bc" . to_tendril ( ) ) ;
111
- assert_eq ! ( bq. eat( "abcd" , u8 :: eq_ignore_ascii_case) , None ) ;
112
- assert_eq ! ( bq. eat( "ax" , u8 :: eq_ignore_ascii_case) , Some ( false ) ) ;
113
- assert_eq ! ( bq. eat( "ab" , u8 :: eq_ignore_ascii_case) , Some ( true ) ) ;
114
- assert_eq ! ( bq. next( ) , Some ( 'c' ) ) ;
115
- assert_eq ! ( bq. next( ) , None ) ;
116
- }
117
- }
0 commit comments