From 2a95ff633e83300e6f38acb4bbaa1c68b336f7e1 Mon Sep 17 00:00:00 2001 From: Patric Bucher Date: Sat, 25 Nov 2023 17:29:42 +0100 Subject: [PATCH] Fixing tests --- src/compiler/scanner.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/scanner.rs b/src/compiler/scanner.rs index 3eaed36..ca7c307 100644 --- a/src/compiler/scanner.rs +++ b/src/compiler/scanner.rs @@ -294,12 +294,12 @@ mod tests { assert_eq!(x[0].token_type, TokenType::Var); assert_eq!(x[0].start, 0); - assert_eq!(x[0].length, 3); + assert_eq!(x[0].token, "var"); assert_eq!(x[0].line, 1); assert_eq!(x[1].token_type, TokenType::Identifier); assert_eq!(x[1].start, 4); - assert_eq!(x[1].length, 1); + assert_eq!(x[1].token, "a"); assert_eq!(x[1].line, 1); assert_eq!(x[2].token_type, TokenType::Equal); @@ -319,12 +319,12 @@ mod tests { assert_eq!(x[0].token_type, TokenType::Var); assert_eq!(x[0].start, 0); - assert_eq!(x[0].length, 3); + assert_eq!(x[0].token, "var"); assert_eq!(x[0].line, 1); assert_eq!(x[1].token_type, TokenType::Identifier); assert_eq!(x[1].start, 4); - assert_eq!(x[1].length, 1); + assert_eq!(x[1].token, "a"); assert_eq!(x[1].line, 1); assert_eq!(x[2].token_type, TokenType::Equal);