-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel_spec.rs
More file actions
39 lines (34 loc) · 938 Bytes
/
model_spec.rs
File metadata and controls
39 lines (34 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use rstest::rstest;
use fun_html::{Attribute, Element};
#[rstest]
#[cfg(debug_assertions)]
#[should_panic]
fn should_panic_for_invalid_attribute_name(
#[values("hello world", "hello\tworld", "hello\nworld", "")] name: &'static str,
) {
Attribute::new(name, "value");
}
#[rstest]
#[cfg(debug_assertions)]
#[should_panic]
fn should_panic_for_invalid_attribute_flag_name(
#[values("hello world", "hello\tworld", "hello\nworld", "")] name: &'static str,
) {
Attribute::new_flag(name);
}
#[rstest]
#[cfg(debug_assertions)]
#[should_panic]
fn should_panic_for_invalid_tag_name(
#[values("hello world", "hello\tworld", "hello\nworld", "")] name: &'static str,
) {
Element::new(name, [], []);
}
#[rstest]
#[cfg(debug_assertions)]
#[should_panic]
fn should_panic_for_invalid_void_element_name(
#[values("hello world", "hello\tworld", "hello\nworld", "")] name: &'static str,
) {
Element::new_void(name, []);
}