mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.
25 lines
691 B
Rust
25 lines
691 B
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
#[test]
|
|
fn test_trim_http_whitespace() {
|
|
fn test_trim(in_: &[u8], out: &[u8]) {
|
|
let b = net_traits::trim_http_whitespace(in_);
|
|
assert_eq!(b, out);
|
|
}
|
|
|
|
test_trim(b"", b"");
|
|
|
|
test_trim(b" ", b"");
|
|
test_trim(b"a", b"a");
|
|
test_trim(b" a", b"a");
|
|
test_trim(b"a ", b"a");
|
|
test_trim(b" a ", b"a");
|
|
|
|
test_trim(b"\t", b"");
|
|
test_trim(b"a", b"a");
|
|
test_trim(b"\ta", b"a");
|
|
test_trim(b"a\t", b"a");
|
|
test_trim(b"\ta\t", b"a");
|
|
}
|