<!-- Please describe your changes on the following line: --> https://github.com/servo/rust-cssparser/pull/123 In particular, `match_ignore_ascii_case` now supports the full `match` syntax. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: fbfcfc2dbe838ef011f14a863003a575078f455f
36 lines
1.0 KiB
Rust
36 lines
1.0 KiB
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 http://mozilla.org/MPL/2.0/. */
|
|
|
|
use style::str::{split_html_space_chars, str_join};
|
|
|
|
#[test]
|
|
pub fn split_html_space_chars_whitespace() {
|
|
assert!(split_html_space_chars("").collect::<Vec<_>>().is_empty());
|
|
assert!(split_html_space_chars("\u{0020}\u{0009}\u{000a}\u{000c}\u{000d}").collect::<Vec<_>>().is_empty());
|
|
}
|
|
|
|
#[test]
|
|
pub fn test_str_join_empty() {
|
|
let slice: [&str; 0] = [];
|
|
let actual = str_join(&slice, "-");
|
|
let expected = "";
|
|
assert_eq!(actual, expected);
|
|
}
|
|
|
|
#[test]
|
|
pub fn test_str_join_one() {
|
|
let slice = ["alpha"];
|
|
let actual = str_join(&slice, "-");
|
|
let expected = "alpha";
|
|
assert_eq!(actual, expected);
|
|
}
|
|
|
|
#[test]
|
|
pub fn test_str_join_many() {
|
|
let slice = ["", "alpha", "", "beta", "gamma", ""];
|
|
let actual = str_join(&slice, "-");
|
|
let expected = "-alpha--beta-gamma-";
|
|
assert_eq!(actual, expected);
|
|
}
|