Commit graph

69 commits

Author SHA1 Message Date
Terts Diepraam
c65483f4be tests: improve docstrings a bit 2021-04-07 11:48:21 +02:00
ReggaeMuffin
2eb32d845e
chores: run cargo +1.40.0 fmt
Apparently fmt from 1.40.0 is a bit more strict in some places

Let me know if this is worthwhile merging :)
2021-04-02 10:56:49 +01:00
Sylvestre Ledru
dcbcf01665 Fix some clippy warnings 2021-04-01 23:42:30 +02:00
paulotten
090d29496a
Issue #1622 port du to windows (#1788)
* Issue #1622 port `du` to windows

* Attempt to support Rust 1.32

Old version was getting "attributes are not yet allowed on `if`
expressions" on Rust 1.32

* Less #[cfg]

* Less duplicate code.

I need the return and the semicolon after if otherwise the second #[cfg]
leads to unexpected token complilation error

* More accurate size on disk calculations for windows

* Expect the same output on windows as with WSL

* Better matches output from du on WSL

* In the absence of feedback I'm disabling these tests on Windows.
They require `ln`. Windows does not ship with this utility.

* Use the coreutils version of `ln` to test `du`

`fn ccmd` is courtesy of @Artoria2e5

* Look up inodes (file ids) on Windows

* One more #[cfg(windows)] to prevent unreachable statement warning on linux
2021-04-01 23:16:47 +02:00
Mikadore
b8079098f2 fixed panic! formatting 2021-03-31 13:30:06 +02:00
Mikadore
96643d6f91
fix #1970 (#1980) 2021-03-31 03:54:16 -07:00
Mikadore
a57f17ac5b
Expand CmdResult's API (#1977) 2021-03-31 02:25:23 -07:00
Ricardo Iglesias
5f17719a59
Implemented --indicator-style flag on ls. (#1907)
* Implemented --indicator-style flag on ls.

* Rust fmt

* Grouped indicator_style args.

* Added tests for sockets and pipes.

Needed to modify util.rs to add support for pipes (aka FIFOs).

* Updated util.rs to remove FIFO operations on Windows

* Fixed slight error in specifying (not(windows))

* Fixed style violations and added indicator_style test for non-unix systems
2021-03-29 13:10:13 +02:00
Neculai Balaban
93c7cbe65e documentation for usual macros
- removed repeat_str helper as it's now part of std
- added docstrings for usual macros and test utils
2021-03-22 12:13:38 +02:00
Jan Scheer
47f50a0f5f
tests/utils: fixed mode for write (#1802)
added `log_info`
2021-03-12 22:26:27 +01:00
Ali
5ced3a670b
paste: cleanup multi-stdin support (#1803)
cleaner impl for multi-stdin support
2021-03-12 13:26:09 +01:00
Alex Lyon
5431e947bc
uucore: process: fix exit status processing (#1743)
* uucore: process: fix exit status processing

* tests: timeout: check whether subcommand exit codes are returned
2021-02-23 10:21:01 +01:00
Sylvestre Ledru
992c113f09 Remove some old code 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
e331186fee
unbreak build with rustc 1.32: force tempfile 3.1.0 (#1695) 2021-01-19 08:15:53 +01:00
Felipe Lema
88911be6e0
--filter argument for split (#1681) 2021-01-18 14:42:44 +01:00
Roy Ivy III
cbac6cc903 tests ~ increase test detail to diagnose MacOS hostname test failure 2020-06-14 23:38:30 -05:00
Roy Ivy III
407d455b12 tests ~ add is_ci() test 2020-06-14 12:20:31 -05:00
Sylvestre Ledru
ac34d136f2 refactor(global): Move from tempdir to tempfile:
* the crate has been deprecated
2020-06-09 11:30:19 +02:00
Roy Ivy III
039638de0e tests ~ use CARGO_PKG_NAME as name of binary used for testing 2020-05-29 22:59:47 -05:00
Roy Ivy III
75f05df119 refactor/polish ~ fix cargo clippy complaints (redundant_static_lifetimes) 2020-04-11 18:50:10 -05:00
Roy Ivy III
5af8503a5e cargo fmt 2020-01-28 00:05:06 -06:00
Roy Ivy III
14c3f3aa17 tests ~ fix WSL testing
+ ToDO added ~ when possible, test under WSL2 and differentiate/liberalize if possible
2020-01-27 21:33:47 -06:00
Roy Ivy III
d0f6f3d07e tests/refactor ~ change output test macros to 'actual = expected' format
- rust usually uses `assert_eq!(ACTUAL, EXPECTED)`
- ref: https://users.rust-lang.org/t/assert-eq-expected-and-actual/20304/3 @@ https://archive.is/xPp9R
2020-01-27 21:33:47 -06:00
Roy Ivy III
b4b0ee40d7 refactor/polish ~ convert to try! to ? syntax
- convert to newer `?` syntax, fixing compiler warnings

+ requires MinSRV >= v1.13.0

.# [why]

The `?` operator was stabilized in rust v1.13.0.

Warnings requesting conversion from the old `try!` macro to the `?` operator
were introduced in rust v1.39.0.

* ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md>
2020-01-27 21:33:47 -06:00
Alex Lyon
179de609b5 Replace trim_{left,right} with trim_{start,end} and co. (using Rerast) 2019-05-01 21:14:25 -07:00
Alex Lyon
c7d115b1ad Convert all try!() to ? 2019-05-01 21:14:25 -07:00
Roy Ivy III
f72fff7b42 augment UCommand with #[derive(Debug)] to allow improved test diagnostics 2019-04-29 09:46:15 -05:00
Reto Habluetzel
2d2042c8fc env: reject program with --null, error stderr 2019-04-28 11:17:44 +02:00
Alex Lyon
23f6dbf2d3
Merge pull request #1306 from rinconjc/1235
tests: untrimmed stdout assertion (fix #1235)
2019-04-05 22:22:18 -07:00
Julio Rincon
29c6ad5f6a tests: untrimmed stdout assertion (fix #1235) 2019-02-08 07:54:48 +11:00
Roy Ivy III
f3d43d775a fix ~ correct symlink creation in tests 2019-02-07 08:30:51 -06:00
Alex Lyon
880a4973c1 Format everything using rustfmt 2018-03-12 01:20:58 -07:00
Alex Lyon
e9f32fe170 realpath, relpath, tests: fix build on nightly 2018-01-16 15:11:46 -08:00
knight42
fdbbb08aef tests: expand $OUT_DIR at compile time 2016-12-20 03:28:47 +08:00
knight42
a0ff0f623a Temporary fix for errors in testing
The errors were caused by the missing env $OUT_DIR which should be set by
cargo.

[Related issue](https://github.com/rust-lang/cargo/issues/3368).
2016-12-08 12:36:07 +08:00
Joseph Crail
b3680a5baf Fix clippy warnings 2016-11-25 14:14:46 -05:00
knight42
c277793f38 touch: add test 2016-08-28 07:12:58 +08:00
nathanross
b667fce8ba clone atpath to avoid borrow issue 2016-08-23 08:57:13 -04:00
Nathan Ross
fae1e92767 tests/common: more communicative assertion failure messages
often when stdout is wrong, differences in stderr are
more useful for determining the cause
2016-08-08 02:54:22 -04:00
Knight
cfc28ebc05 tests: extern crates in separated test modules 2016-08-07 01:12:19 +08:00
Nathan Ross
569cd162d3 tests: refactor conventional TestScenario usage
Updates to individual integration tests

  - use proposed conventional approach to beginning tests

  - use new convenience functions for using fixtures

  - use new names for TestScenario

Updates to integration test modules

  - add proposed conventional module-level functions

Updates to test/common/util.rs

  - rename TestSet, and its methods, for semantic clarity

  - create convenience functions for use of fixtures

  - delete convenience functions obsoleted by new conventions
2016-08-01 13:42:00 -04:00
Nathan Ross
eb976214d8 tests/common: use more idiomatic asserts 2016-07-17 13:33:03 -04:00
Nathan Ross
fa11f277ea tests/common: document more structs and functions of util.rs 2016-07-17 05:20:33 -04:00
Knight
e486fefa0f test::common::util::read_size: prolong the sleep 2016-06-17 22:45:35 +08:00
Joseph Crail
56c9ccc347 tests/common: remove prefixed chars on Windows 2016-05-22 22:54:45 -04:00
Joseph Crail
a7a10f357a tests: remove scoped files
Scoped files were deprecated by scoped temporary directories used by the
test harness.
2016-05-22 15:31:02 -04:00
Joseph Crail
8d42cecc5f tests: remove unused comment 2016-05-22 15:15:57 -04:00
Joseph Crail
6652e6b57d tests: un-hardcode executable artifact 2016-05-22 15:10:46 -04:00
Joseph Crail
89b600628d tests: move macros into separate module 2016-05-22 15:10:06 -04:00
Heather
bdc1ca7426 Merge pull request #882 from jbcrail/fix-windows-build
Improve Windows build
2016-05-22 16:02:03 +04:00