mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
25 lines
529 B
Rust
25 lines
529 B
Rust
mod common;
|
|
use common::expect_repl_success;
|
|
|
|
#[test]
|
|
fn exec_repl_helloworld() -> Result<(), ()> {
|
|
expect_repl_success(
|
|
"repl_hello",
|
|
vec!["print! \"hello, world\"".into(), "exit()".into()],
|
|
)
|
|
}
|
|
|
|
#[test]
|
|
fn exec_repl_def_func() -> Result<(), ()> {
|
|
expect_repl_success(
|
|
"repl_def",
|
|
vec![
|
|
"f i =".into(),
|
|
" i + 1".into(),
|
|
"".into(),
|
|
"x = f 2".into(),
|
|
"assert x == 3".into(),
|
|
"exit()".into(),
|
|
],
|
|
)
|
|
}
|