2023-04-05 20:44:59 +00:00
|
|
|
use crate::tests::{fail_test, run_test, TestResult};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn library_loaded() -> TestResult {
|
|
|
|
run_test(
|
|
|
|
"help std | lines | first 1 | to text",
|
|
|
|
"std.nu, `used` to load all standard library components",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn prelude_loaded() -> TestResult {
|
2023-04-07 18:04:51 +00:00
|
|
|
run_test("std help commands | where name == open | length", "1")
|
2023-04-05 20:44:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn not_loaded() -> TestResult {
|
2023-04-07 18:04:51 +00:00
|
|
|
fail_test("log info", "")
|
2023-04-05 20:44:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn use_command() -> TestResult {
|
2023-04-07 18:04:51 +00:00
|
|
|
run_test("use std assert; assert true; print 'it works'", "it works")
|
2023-04-05 20:44:59 +00:00
|
|
|
}
|