File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -114,3 +114,32 @@ impl_encode!(
114114 domain_name_without_compression,
115115 encode_without_compression
116116) ;
117+
118+ #[ test]
119+ fn domain_name_without_compression_1 ( ) {
120+ let domain_name: DomainName = "example.org." . parse ( ) . unwrap ( ) ;
121+ let mut encoder = Encoder :: default ( ) ;
122+ encoder
123+ . domain_name_without_compression ( & domain_name)
124+ . unwrap ( ) ;
125+ encoder
126+ . domain_name_without_compression ( & domain_name)
127+ . unwrap ( ) ;
128+ assert_eq ! (
129+ encoder. bytes,
130+ & b"\x07 example\x03 org\0 \x07 example\x03 org\0 " [ ..]
131+ ) ;
132+ }
133+
134+ #[ test]
135+ fn domain_name_without_compression_2 ( ) {
136+ let domain_name = DomainName :: default ( ) ;
137+ let mut encoder = Encoder :: default ( ) ;
138+ encoder
139+ . domain_name_without_compression ( & domain_name)
140+ . unwrap ( ) ;
141+ encoder
142+ . domain_name_without_compression ( & domain_name)
143+ . unwrap ( ) ;
144+ assert_eq ! ( encoder. bytes, & b"\0 \0 " [ ..] ) ;
145+ }
You can’t perform that action at this time.
0 commit comments