Differentiate internal signature from external signature w.r.t. help (#5667)

* Differentiate internal signature from external signature w.r.t. help

* Add in the --help flag to default externs in default config

* Remove unusued build_extern

Co-authored-by: mjclements <clements.michael.james@gmail.com>
This commit is contained in:
Clements
2022-05-29 09:14:15 -04:00
committed by GitHub
parent 23a73cd31f
commit 46eb34b35d
5 changed files with 42 additions and 23 deletions

View File

@ -1,4 +1,4 @@
use crate::tests::{fail_test, run_test, TestResult};
use crate::tests::{fail_test, run_test, run_test_contains, TestResult};
#[test]
fn no_scope_leak1() -> TestResult {
@ -117,3 +117,16 @@ fn allow_missing_optional_params() -> TestResult {
"5",
)
}
#[test]
fn help_present_in_def() -> TestResult {
run_test_contains("def foo [] {}; help foo;", "Display this help message")
}
#[test]
fn help_not_present_in_extern() -> TestResult {
run_test(
"module test {export extern \"git fetch\" []}; use test; help git fetch",
"Usage:\n > git fetch",
)
}