25 lines
545 B
Rust
Raw Normal View History

2018-08-22 21:06:23 -04:00
use serde_test::{assert_tokens, Token};
#[test]
fn test_raw_identifiers() {
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
enum r#type {
2018-09-01 23:03:41 -07:00
r#type { r#type: () },
2018-08-22 21:06:23 -04:00
}
assert_tokens(
&r#type::r#type { r#type: () },
&[
2018-09-01 23:03:41 -07:00
Token::StructVariant {
name: "type",
variant: "type",
len: 1,
},
2018-08-22 21:06:23 -04:00
Token::Str("type"),
Token::Unit,
Token::StructVariantEnd,
],
);
}