mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
test: add external
test
This commit is contained in:
parent
cfd24ea6fc
commit
6d12e09b29
3 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
time = pyimport "time"
|
||||
tqdm = pyimport "tqdm"
|
||||
j2 = pyimport "jinja2"
|
||||
|
||||
for! tqdm.Tqdm!(0..<100), _ =>
|
||||
time.sleep! 0.01
|
||||
|
@ -10,3 +11,6 @@ discard plt.plot! 0..<10, [2, 3, 2, 3, 2, 3, 2, 3, 2, 3]
|
|||
discard plt.title! "My Plot"
|
||||
discard plt.xlabel! "X"
|
||||
plt.show!()
|
||||
|
||||
res = j2.Template("Hello {{ name }}!").render(name:="World")
|
||||
assert res == "Hello World!"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
time = pyimport "time"
|
||||
tqdm = pyimport "tqdm"
|
||||
j2 = pyimport "jinja2"
|
||||
|
||||
for! tqdm.Tqdm!(0..<10), _ =>
|
||||
time.sleep! 0.00001
|
||||
|
@ -10,3 +11,6 @@ discard plt.plot! 0..<10, [2, 3, 2, 3, 2, 3, 2, 3, 2, 3]
|
|||
discard plt.title! "My Plot"
|
||||
discard plt.xlabel! "X"
|
||||
# plt.show!()
|
||||
|
||||
res = j2.Template("Hello {{ name }}!").render(name:="World")
|
||||
assert res == "Hello World!"
|
||||
|
|
|
@ -124,7 +124,10 @@ fn exec_empty_check() -> Result<(), ()> {
|
|||
#[test]
|
||||
fn exec_external() -> Result<(), ()> {
|
||||
let py_command = opt_which_python().unwrap();
|
||||
if module_exists(&py_command, "matplotlib") && module_exists(&py_command, "tqdm") {
|
||||
if module_exists(&py_command, "matplotlib")
|
||||
&& module_exists(&py_command, "tqdm")
|
||||
&& module_exists(&py_command, "jinja2")
|
||||
{
|
||||
expect_success("tests/should_ok/external.er", 0)
|
||||
} else {
|
||||
expect_compile_success("tests/should_ok/external.er", 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue