()
| 943 | |
| 944 | #[test] |
| 945 | fn test_token_kind_encoding_roundtrip() { |
| 946 | let kinds = [ |
| 947 | TokenKind::Word, |
| 948 | TokenKind::Whitespace, |
| 949 | TokenKind::Operator, |
| 950 | TokenKind::Punctuation, |
| 951 | TokenKind::String, |
| 952 | TokenKind::Number, |
| 953 | TokenKind::Comment, |
| 954 | TokenKind::Newline, |
| 955 | TokenKind::Other, |
| 956 | ]; |
| 957 | |
| 958 | for kind in kinds { |
| 959 | let encoded = encode_token_kind(kind); |
| 960 | let decoded = decode_token_kind(encoded); |
| 961 | assert_eq!(kind, decoded, "Failed for {:?}", kind); |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | #[test] |
| 966 | fn test_token_kind_encoding_unknown_defaults_to_other() { |
nothing calls this directly
no test coverage detected