Compare commits
No commits in common. "06c78ddf4dd853dbf04e69bc7451dbd2fdea7aa6" and "80f4556786da166cc233bb8f4fdb497e54d75b3c" have entirely different histories.
06c78ddf4d
...
80f4556786
|
@ -60,7 +60,7 @@ Read [this guide](https://git-send-email.io) for more information.
|
|||
- [x] Better documentation
|
||||
- [ ] Ability to explicitly print math output and assign math output to variables
|
||||
- [x] Add support for comments (should be pretty easy)
|
||||
- [x] Unit testing and CI/CD
|
||||
- [ ] Unit testing and CI/CD
|
||||
|
||||
## License
|
||||
|
||||
|
|
22
drone.yml
22
drone.yml
|
@ -1,22 +0,0 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: rust-latest
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: rust:1.49.0
|
||||
commands:
|
||||
- cargo build --verbose
|
||||
- cargo test --verbose
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: rust-nightly
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: rustlang/rust:nightly
|
||||
commands:
|
||||
- cargo build --verbose
|
||||
- cargo test --verbose
|
27
src/main.rs
27
src/main.rs
|
@ -128,30 +128,3 @@ fn main() {
|
|||
let mut prog = Program::from_string(contents);
|
||||
prog.run();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn make_program(contents: &str) -> Program {
|
||||
Program::from_string(contents.to_string())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_math() {
|
||||
assert_eq!(eval::do_math("2-2".to_string(), '+'), 4);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_undefined_opcode() {
|
||||
make_program("Hello\nWorld!").run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_undefined_variable() {
|
||||
make_program("p$v").run();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user