Adopt the Rust test builtin

This switches the builtin test implementation from C++ to Rust
This commit is contained in:
ridiculousfish
2023-05-20 17:46:27 -07:00
parent 10a7de03e2
commit cdb77a6176
3 changed files with 5 additions and 0 deletions

View File

@@ -183,6 +183,7 @@ pub fn run_builtin(
RustBuiltin::Random => super::random::random(parser, streams, args),
RustBuiltin::Realpath => super::realpath::realpath(parser, streams, args),
RustBuiltin::Return => super::r#return::r#return(parser, streams, args),
RustBuiltin::Test => super::test::test(parser, streams, args),
RustBuiltin::Type => super::r#type::r#type(parser, streams, args),
RustBuiltin::Wait => wait::wait(parser, streams, args),
RustBuiltin::Printf => printf::printf(parser, streams, args),

View File

@@ -562,6 +562,9 @@ static maybe_t<RustBuiltin> try_get_rust_builtin(const wcstring &cmd) {
if (cmd == L"realpath") {
return RustBuiltin::Realpath;
}
if (cmd == L"test" || cmd == L"[") {
return RustBuiltin::Test;
}
if (cmd == L"type") {
return RustBuiltin::Type;
}

View File

@@ -127,6 +127,7 @@ enum class RustBuiltin : int32_t {
Random,
Realpath,
Return,
Test,
Type,
Wait,
};