mirror of
https://github.com/nushell/nushell
synced 2025-01-17 23:54:15 +00:00
10a42de64f
# Description ```nushell log critical "this is a critical message" log error "this is an error message" log warning "this is a warning message" log info "this is an info message" log debug "this is a debug message" ``` ![image](https://user-images.githubusercontent.com/282320/225071852-1ddf0e87-d12b-452d-9598-5122df7123ab.png) # Tests + Formatting Tests are written. To run automatically, #8443 needs to be merged before or after this PR. --------- Co-authored-by: Mate Farkas <Mate.Farkas@oneidentity.com>
21 lines
684 B
Text
21 lines
684 B
Text
use std.nu *
|
|
|
|
def main [] {
|
|
for test_file in (ls ($env.FILE_PWD | path join "test_*.nu") -f | get name) {
|
|
let $module_name = ($test_file | path parse).stem
|
|
|
|
log info $"Run tests in ($module_name) module"
|
|
let tests = (
|
|
nu -c $'use ($test_file) *; $nu.scope.commands | select name module_name | to nuon'
|
|
| from nuon
|
|
| where module_name == $module_name
|
|
| where ($it.name | str starts-with "test_")
|
|
| get name
|
|
)
|
|
|
|
for test_case in $tests {
|
|
log debug $"Run test ($module_name) ($test_case)"
|
|
nu -c $'use ($test_file) ($test_case); ($test_case)'
|
|
}
|
|
}
|
|
}
|