mirror of
https://github.com/doukutsu-rs/lua-ffi.git
synced 2026-08-24 13:04:22 -07:00
21 lines
447 B
Rust
21 lines
447 B
Rust
extern crate luajit;
|
|
|
|
use luajit::{State, ThreadStatus};
|
|
|
|
#[test]
|
|
fn do_valid_string() {
|
|
let mut state = State::new();
|
|
state.open_libs();
|
|
|
|
let status = state.do_string(r#"print("Hello world!")"#);
|
|
assert!(status == ThreadStatus::Ok);
|
|
}
|
|
|
|
#[test]
|
|
fn do_invalid_string() {
|
|
let mut state = State::new();
|
|
state.open_libs();
|
|
|
|
let status = state.do_string("aqdw98hdqw");
|
|
assert!(status == ThreadStatus::SyntaxError);
|
|
} |