mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
19 lines
429 B
Rust
19 lines
429 B
Rust
mod common;
|
|
use common::expect_repl_success;
|
|
|
|
#[test]
|
|
fn exec_repl_helloworld() -> Result<(), ()> {
|
|
expect_repl_success(vec!["print! \"hello, world\"".into(), "exit()".into()])
|
|
}
|
|
|
|
#[test]
|
|
fn exec_repl_def_func() -> Result<(), ()> {
|
|
expect_repl_success(vec![
|
|
"f i =".into(),
|
|
" i + 1".into(),
|
|
"".into(),
|
|
"x = f 2".into(),
|
|
"assert x == 3".into(),
|
|
"exit()".into(),
|
|
])
|
|
}
|