mirror of
https://github.com/nushell/nushell.git
synced 2024-11-07 09:04:18 +01:00
Merged tests to produce a single binary (#12826)
This PR should close #7147 # Description Merged src/tests into /tests to produce a single binary. ![image](https://github.com/nushell/nushell/assets/94604837/84726469-d447-4619-b6d1-2d1415d0f42e) # User-Facing Changes No user facing changes # Tests + Formatting Moved tests. Tollkit check pr pass. # After Submitting --------- Co-authored-by: Ian Manske <ian.manske@pm.me>
This commit is contained in:
parent
c70c43aae9
commit
c4dca5fe03
@ -55,7 +55,6 @@ It is good practice to cover your changes with a test. Also, try to think about
|
||||
|
||||
Tests can be found in different places:
|
||||
* `/tests`
|
||||
* `src/tests`
|
||||
* command examples
|
||||
* crate-specific tests
|
||||
|
||||
|
@ -7,8 +7,6 @@ mod signals;
|
||||
#[cfg(unix)]
|
||||
mod terminal;
|
||||
mod test_bins;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
#[cfg(feature = "mimalloc")]
|
||||
#[global_allocator]
|
||||
|
@ -11,5 +11,6 @@ mod path;
|
||||
mod plugin_persistence;
|
||||
#[cfg(feature = "plugin")]
|
||||
mod plugins;
|
||||
mod repl;
|
||||
mod scope;
|
||||
mod shell;
|
||||
|
27
tests/repl/mod.rs
Normal file
27
tests/repl/mod.rs
Normal file
@ -0,0 +1,27 @@
|
||||
mod test_bits;
|
||||
mod test_cell_path;
|
||||
mod test_commandline;
|
||||
mod test_conditionals;
|
||||
mod test_config;
|
||||
mod test_config_path;
|
||||
mod test_converters;
|
||||
mod test_custom_commands;
|
||||
mod test_engine;
|
||||
mod test_env;
|
||||
mod test_help;
|
||||
mod test_hiding;
|
||||
mod test_ide;
|
||||
mod test_iteration;
|
||||
mod test_known_external;
|
||||
mod test_math;
|
||||
mod test_modules;
|
||||
mod test_parser;
|
||||
mod test_ranges;
|
||||
mod test_regex;
|
||||
mod test_signatures;
|
||||
mod test_spread;
|
||||
mod test_stdlib;
|
||||
mod test_strings;
|
||||
mod test_table_operations;
|
||||
mod test_type_check;
|
||||
mod tests;
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{run_test, TestResult};
|
||||
use crate::repl::tests::{run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn bits_and() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
// Tests for null / null / Value::Nothing
|
||||
#[test]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn commandline_test_get_empty() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{run_test, TestResult};
|
||||
use crate::repl::tests::{run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn if_test1() -> TestResult {
|
@ -1,5 +1,4 @@
|
||||
use super::{fail_test, run_test, run_test_std};
|
||||
use crate::tests::TestResult;
|
||||
use crate::repl::tests::{fail_test, run_test, run_test_std, TestResult};
|
||||
|
||||
#[test]
|
||||
fn mutate_nu_config() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{run_test, TestResult};
|
||||
use crate::repl::tests::{run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn from_json_1() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, run_test_contains, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, run_test_contains, TestResult};
|
||||
use nu_test_support::nu;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
use rstest::rstest;
|
||||
|
||||
#[test]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
use nu_test_support::nu;
|
||||
|
||||
#[test]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{run_test, TestResult};
|
||||
use crate::repl::tests::{run_test, TestResult};
|
||||
use rstest::rstest;
|
||||
|
||||
#[rstest]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
// TODO: Test the use/hide tests also as separate lines in REPL (i.e., with merging the delta in between)
|
||||
#[test]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{test_ide_contains, TestResult};
|
||||
use crate::repl::tests::{test_ide_contains, TestResult};
|
||||
|
||||
#[test]
|
||||
fn parser_recovers() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{run_test, TestResult};
|
||||
use crate::repl::tests::{run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn better_block_types() -> TestResult {
|
@ -1,7 +1,6 @@
|
||||
use crate::repl::tests::{fail_test, run_test, run_test_contains, TestResult};
|
||||
use std::process::Command;
|
||||
|
||||
use crate::tests::{fail_test, run_test, run_test_contains, TestResult};
|
||||
|
||||
// cargo version prints a string of the form:
|
||||
// cargo 1.60.0 (d1fd9fe2c 2022-03-01)
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn add_simple() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn module_def_imports_1() -> TestResult {
|
@ -1,9 +1,7 @@
|
||||
use crate::tests::{fail_test, run_test, run_test_with_env, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, run_test_contains, run_test_with_env, TestResult};
|
||||
use nu_test_support::{nu, nu_repl_code};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::run_test_contains;
|
||||
|
||||
#[test]
|
||||
fn env_shorthand() -> TestResult {
|
||||
run_test("FOO=BAR if false { 3 } else { 4 }", "4")
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn int_in_inc_range() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn contains() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn list_annotations() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
use nu_test_support::nu;
|
||||
|
||||
#[test]
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test_std, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test_std, TestResult};
|
||||
|
||||
#[test]
|
||||
fn library_loaded() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn cjk_in_substrings() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn illegal_column_duplication() -> TestResult {
|
@ -1,4 +1,4 @@
|
||||
use crate::tests::{fail_test, run_test, TestResult};
|
||||
use crate::repl::tests::{fail_test, run_test, TestResult};
|
||||
|
||||
#[test]
|
||||
fn chained_operator_typecheck() -> TestResult {
|
@ -1,30 +1,3 @@
|
||||
mod test_bits;
|
||||
mod test_cell_path;
|
||||
mod test_commandline;
|
||||
mod test_conditionals;
|
||||
mod test_config;
|
||||
mod test_config_path;
|
||||
mod test_converters;
|
||||
mod test_custom_commands;
|
||||
mod test_engine;
|
||||
mod test_env;
|
||||
mod test_help;
|
||||
mod test_hiding;
|
||||
mod test_ide;
|
||||
mod test_iteration;
|
||||
mod test_known_external;
|
||||
mod test_math;
|
||||
mod test_modules;
|
||||
mod test_parser;
|
||||
mod test_ranges;
|
||||
mod test_regex;
|
||||
mod test_signatures;
|
||||
mod test_spread;
|
||||
mod test_stdlib;
|
||||
mod test_strings;
|
||||
mod test_table_operations;
|
||||
mod test_type_check;
|
||||
|
||||
use assert_cmd::prelude::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::collections::HashMap;
|
Loading…
Reference in New Issue
Block a user