MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_token_kind_encoding_roundtrip

Function test_token_kind_encoding_roundtrip

atomic-core/src/crdt/tables.rs:945–963  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

encode_token_kindFunction · 0.85
decode_token_kindFunction · 0.85

Tested by

no test coverage detected