modified SEN-109

This commit is contained in:
Win 2025-02-03 15:45:32 +07:00
parent 3bbde3d84f
commit 53b8ececc8
78 changed files with 23 additions and 2 deletions

View File

@ -1 +0,0 @@
,winsdominoes,bluefin,02.02.2025 21:33,file:///var/home/winsdominoes/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4;

View File

@ -45,6 +45,15 @@ pub fn eval(expr: Node) -> Result<f64, Box<dyn error::Error>> {
mod tests {
use super::*;
#[test]
fn test_add_expr()
{
use crate::parsemath::parser::Parser;
let ast = Parser::new("1+2").unwrap().parse().unwrap();
let value = eval(ast).unwrap();
assert_eq!(value, 3.0);
}
#[test]
fn test_expr1() {
use crate::parsemath::parser::Parser;
@ -64,7 +73,7 @@ mod tests {
fn test_expr3() {
use crate::parsemath::parser::Parser;
let ast = Parser::new("3+3 | 4").unwrap().parse().unwrap();
let ast = Parser::new("3+3|4").unwrap().parse().unwrap();
let value = eval(ast).unwrap();
assert_eq!(value, 6.0);
}

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1 @@
{"rustc":11594289678289209806,"features":"[]","declared_features":"[]","target":9339122733587503447,"profile":15632368228915330634,"path":10602529704205407992,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/expression-eval-de105a88ab61feba/dep-test-bin-expression-eval","checksum":false}}],"rustflags":[],"metadata":2918638759235091062,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1,10 @@
/workspaces/cmkl/spring-2025/sen-109/00020/eval/target/debug/deps/expression_eval-de105a88ab61feba: src/main.rs src/parsemath/mod.rs src/parsemath/ast.rs src/parsemath/parser.rs src/parsemath/token.rs src/parsemath/tokenizer.rs
/workspaces/cmkl/spring-2025/sen-109/00020/eval/target/debug/deps/expression_eval-de105a88ab61feba.d: src/main.rs src/parsemath/mod.rs src/parsemath/ast.rs src/parsemath/parser.rs src/parsemath/token.rs src/parsemath/tokenizer.rs
src/main.rs:
src/parsemath/mod.rs:
src/parsemath/ast.rs:
src/parsemath/parser.rs:
src/parsemath/token.rs:
src/parsemath/tokenizer.rs: