From f1d19b73dbaabe831ae9f3eead64b19a429cadc6 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Thu, 14 Nov 2024 21:31:26 -0500 Subject: [PATCH] remove test cruft --- src/main.rs | 95 ----------------------------------------------------- 1 file changed, 95 deletions(-) diff --git a/src/main.rs b/src/main.rs index 92c1e92..0c12a63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,98 +76,3 @@ pub fn main() { println!("{}", result); } - -// #[cfg(test)] -// mod tests { -// use crate::lexer; -// use crate::Token; -// use chumsky::prelude::*; - -// #[test] -// fn it_lexes_positive_ints() { -// let (mytoken, _) = lexer().parse("42").unwrap()[0].clone(); -// assert_eq!(mytoken, Token::Number(42.0)) -// } - -// #[test] -// fn it_lexes_negative_ints() { -// let (mytoken, _) = lexer().parse("-42").unwrap()[0].clone(); -// assert_eq!(mytoken, Token::Number(-42.0)) -// } - -// #[test] -// fn it_lexes_positive_floats() { -// let (mytoken, _) = lexer().parse("42.032").unwrap()[0].clone(); -// assert_eq!(mytoken, Token::Number(42.032)) -// } - -// #[test] -// fn it_lexes_positive_decimals() { -// let (mytoken, _) = lexer().parse("0.123").unwrap()[0].clone(); -// assert_eq!(mytoken, Token::Number(0.123)) -// } - -// #[test] -// fn it_lexes_negative_floats() { -// let mytoken = lexer().parse("-42.123").unwrap()[0].clone().0; -// assert_eq!(mytoken, Token::Number(-42.123)) -// } - -// #[test] -// fn it_lexes_negative_decimals() { -// let mytoken = lexer().parse("-0.123").unwrap()[0].clone().0; -// assert_eq!(mytoken, Token::Number(-0.123)) -// } - -// #[test] -// fn it_lexes_bools() { -// let tt = lexer().parse("true").unwrap()[0].clone().0; -// assert_eq!(tt, Token::Boolean(true)); -// let ff = lexer().parse("false").unwrap()[0].clone().0; -// assert_eq!(ff, Token::Boolean(false)) -// } - -// #[test] -// fn it_lexes_words() { -// let mytoken = lexer().parse("foo").unwrap()[0].clone().0; -// assert_eq!(mytoken, Token::Word("foo")) -// } - -// #[test] -// fn it_lexes_keywords() { -// let kw = lexer().parse(":foo").unwrap()[0].clone().0; -// assert_eq!(kw, Token::Keyword("foo")) -// } - -// #[test] -// fn it_lexes_strings() { -// let s = lexer().parse("\"foo bar baz\"").unwrap()[0].clone().0; -// assert_eq!(s, Token::String("foo bar baz")) -// } - -// #[test] -// fn it_ignores_comments() { -// let e = lexer().parse("foo &bar\nbaz").unwrap(); -// assert_eq!(e[0].0, Token::Word("foo")); -// assert_eq!(e[1].0, Token::Punctuation("\n")); -// assert_eq!(e[2].0, Token::Word("baz")) -// } - -// #[test] -// fn it_lexes_multiple_tokens() { -// let toks = lexer().parse("foo;bar\nbaz").unwrap(); -// assert_eq!(toks[0].0, Token::Word("foo")); -// assert_eq!(toks[2].0, Token::Word("bar")); -// assert_eq!(toks[4].0, Token::Word("baz")) -// } - -// #[test] -// fn it_lexes_collections() { -// let toks = lexer().parse("(1, 2)").unwrap(); -// assert_eq!(toks[0].0, Token::Punctuation("(")); -// assert_eq!(toks[1].0, Token::Number(1.0)); -// assert_eq!(toks[2].0, Token::Punctuation(",")); -// assert_eq!(toks[3].0, Token::Number(2.0)); -// assert_eq!(toks[4].0, Token::Punctuation(")")) -// } -// }