2023-04-16 22:24:56 +00:00
|
|
|
use crate::tests::{fail_test, run_test_std, TestResult};
|
2023-04-05 20:44:59 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn library_loaded() -> TestResult {
|
2023-04-16 22:24:56 +00:00
|
|
|
run_test_std(
|
2023-04-05 20:44:59 +00:00
|
|
|
"help std | lines | first 1 | to text",
|
|
|
|
"std.nu, `used` to load all standard library components",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn prelude_loaded() -> TestResult {
|
2023-04-16 22:24:56 +00:00
|
|
|
run_test_std("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-16 22:24:56 +00:00
|
|
|
run_test_std("use std assert; assert true; print 'it works'", "it works")
|
2023-04-05 20:44:59 +00:00
|
|
|
}
|