b0f139f389
This commit introduces a new `tester` module to the `ast` crate, enabling functional tests and performance benchmarks for MYC scripts. Functional tests are executed by reading `.myc` files from the `examples` directory, parsing expected output comments, and comparing them against the actual script execution results. Benchmarking involves measuring the execution time of scripts, calculating median durations, and comparing them against stored baselines. The commit also adds support for updating these baselines. The `ast.rs` CLI and the `main.rs` GUI application have been updated to expose these new testing and benchmarking features. The `Cargo.toml` and `Cargo.lock` files have been updated to include the `regex` dependency required for parsing benchmark comments.
12 lines
171 B
Plaintext
12 lines
171 B
Plaintext
;; Fibonacci Recursive
|
|
;; Benchmark: 62.9us
|
|
;; Output: 55
|
|
(do
|
|
(def fib (fn [n]
|
|
(if (< n 2)
|
|
n
|
|
(+ (fib (- n 1)) (fib (- n 2))))))
|
|
|
|
(fib 10)
|
|
)
|