MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / tokenize_simple

Function tokenize_simple

nodedb-sql/src/parser/array_stmt/lexer.rs:225–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223
224 #[test]
225 fn tokenize_simple() {
226 let toks = tokenize("CREATE ARRAY a (1, 2.5, 'x')").unwrap();
227 assert!(matches!(toks[0].tok, Tok::Ident(ref s) if s == "CREATE"));
228 assert!(matches!(toks[1].tok, Tok::Ident(ref s) if s == "ARRAY"));
229 assert!(matches!(toks[3].tok, Tok::LParen));
230 assert!(matches!(toks[4].tok, Tok::Int(1)));
231 assert!(matches!(toks[6].tok, Tok::Float(f) if (f - 2.5).abs() < 1e-9));
232 assert!(matches!(toks[8].tok, Tok::Str(ref s) if s == "x"));
233 }
234
235 #[test]
236 fn tokenize_dotdot_range() {

Callers

nothing calls this directly

Calls 1

tokenizeFunction · 0.70

Tested by

no test coverage detected