1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 05:27:45 +00:00

Merge branch 'master' of https://github.com/uutils/coreutils into sort-no-json-extsort

This commit is contained in:
Michael Debertol 2021-05-01 17:29:03 +02:00
commit be0c924c95
8 changed files with 47 additions and 45 deletions

46
Cargo.lock generated
View file

@ -12,11 +12,11 @@ dependencies = [
[[package]]
name = "aho-corasick"
version = "0.7.15"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
"memchr 2.3.4",
"memchr 2.4.0",
]
[[package]]
@ -111,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d"
dependencies = [
"lazy_static",
"memchr 2.3.4",
"memchr 2.4.0",
"regex-automata",
"serde",
]
@ -495,9 +495,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
version = "0.9.3"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12"
checksum = "52fb27eab85b17fbb9f6fd667089e07d6a2eb8743d02639ee7f6a7a7729c9c94"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils",
@ -508,9 +508,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.3"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49"
checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278"
dependencies = [
"autocfg",
"cfg-if 1.0.0",
@ -536,7 +536,7 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
dependencies = [
"memchr 2.3.4",
"memchr 2.4.0",
]
[[package]]
@ -868,9 +868,9 @@ dependencies = [
[[package]]
name = "memchr"
version = "2.3.4"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
[[package]]
name = "memoffset"
@ -1089,7 +1089,7 @@ version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
dependencies = [
"unicode-xid 0.2.1",
"unicode-xid 0.2.2",
]
[[package]]
@ -1277,12 +1277,12 @@ dependencies = [
[[package]]
name = "regex"
version = "1.4.6"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759"
checksum = "a068b905b8cb93815aa3069ae48653d90f382308aebd1d33d940ac1f1d771e2d"
dependencies = [
"aho-corasick",
"memchr 2.3.4",
"memchr 2.4.0",
"regex-syntax",
]
@ -1297,9 +1297,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.23"
version = "0.6.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"
checksum = "00efb87459ba4f6fb2169d20f68565555688e1250ee6825cdf6254f8b48fafb2"
[[package]]
name = "remove_dir_all"
@ -1483,7 +1483,7 @@ checksum = "ad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373"
dependencies = [
"proc-macro2",
"quote 1.0.9",
"unicode-xid 0.2.1",
"unicode-xid 0.2.2",
]
[[package]]
@ -1630,9 +1630,9 @@ checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
[[package]]
name = "unicode-xid"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "unindent"
@ -1800,7 +1800,7 @@ version = "0.0.6"
dependencies = [
"bstr",
"clap",
"memchr 2.3.4",
"memchr 2.4.0",
"uucore",
"uucore_procs",
]
@ -2169,7 +2169,7 @@ dependencies = [
"aho-corasick",
"clap",
"libc",
"memchr 2.3.4",
"memchr 2.4.0",
"regex",
"regex-syntax",
"uucore",
@ -2270,7 +2270,7 @@ dependencies = [
"aho-corasick",
"clap",
"libc",
"memchr 2.3.4",
"memchr 2.4.0",
"regex",
"regex-syntax",
"uucore",

View file

@ -125,7 +125,7 @@ fn _factor<A: Arithmetic + miller_rabin::Basis>(num: u64, f: Factors) -> Factors
let n = A::new(num);
let divisor = match miller_rabin::test::<A>(n) {
Prime => {
#[cfg(feature="coz")]
#[cfg(feature = "coz")]
coz::progress!("factor found");
let mut r = f;
r.push(num);
@ -141,7 +141,7 @@ fn _factor<A: Arithmetic + miller_rabin::Basis>(num: u64, f: Factors) -> Factors
}
pub fn factor(mut n: u64) -> Factors {
#[cfg(feature="coz")]
#[cfg(feature = "coz")]
coz::begin!("factorization");
let mut factors = Factors::one();
@ -156,7 +156,7 @@ pub fn factor(mut n: u64) -> Factors {
}
if n == 1 {
#[cfg(feature="coz")]
#[cfg(feature = "coz")]
coz::end!("factorization");
return factors;
}
@ -169,7 +169,7 @@ pub fn factor(mut n: u64) -> Factors {
_factor::<Montgomery<u64>>(n, factors)
};
#[cfg(feature="coz")]
#[cfg(feature = "coz")]
coz::end!("factorization");
return r;

View file

@ -33,7 +33,7 @@ pub(crate) fn factor(mut num: u64, mut factors: Factors) -> (Factors, u64) {
if x <= ceil {
num = x;
k += 1;
#[cfg(feature="coz")]
#[cfg(feature = "coz")]
coz::progress!("factor found");
} else {
if k > 0 {

View file

@ -1559,6 +1559,7 @@ fn get_system_time(md: &Metadata, config: &Config) -> Option<SystemTime> {
match config.time {
Time::Modification => md.modified().ok(),
Time::Access => md.accessed().ok(),
Time::Birth => md.created().ok(),
_ => None,
}
}

View file

@ -158,7 +158,6 @@ pub fn base_conv_float(src: &[u8], radix_src: u8, _radix_dest: u8) -> f64 {
// to implement this for arbitrary string input.
// until then, the below operates as an outline
// of how it would work.
let result: Vec<u8> = vec![0];
let mut factor: f64 = 1_f64;
let radix_src_float: f64 = f64::from(radix_src);
let mut r: f64 = 0_f64;

View file

@ -559,8 +559,7 @@ fn test_ls_long_ctime() {
}
#[test]
#[cfg(not(windows))]
// This test is currently failing on windows
#[ignore]
fn test_ls_order_birthtime() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
@ -570,15 +569,11 @@ fn test_ls_order_birthtime() {
After creating the first file try to sync it.
This ensures the file gets created immediately instead of being saved
inside the OS's IO operation buffer.
Without this, both files might accidentally be created at the same time,
even though we placed a timeout between creating the two.
https://github.com/uutils/coreutils/pull/1986/#issuecomment-828490651
Without this, both files might accidentally be created at the same time.
*/
at.make_file("test-birthtime-1").sync_all().unwrap();
std::thread::sleep(std::time::Duration::from_millis(1));
at.make_file("test-birthtime-2");
at.touch("test-birthtime-1");
at.make_file("test-birthtime-2").sync_all().unwrap();
at.open("test-birthtime-1");
let result = scene.ucmd().arg("--time=birth").arg("-t").run();
@ -589,6 +584,7 @@ fn test_ls_order_birthtime() {
}
#[test]
#[ignore]
fn test_ls_styles() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;

View file

@ -16,15 +16,15 @@ fn test_helper(file_name: &str, args: &str) {
}
// FYI, the initialization size of our Line struct is 96 bytes.
//
// At very small buffer sizes, with that overhead we are certainly going
// to overrun our buffer way, way, way too quickly because of these excess
//
// At very small buffer sizes, with that overhead we are certainly going
// to overrun our buffer way, way, way too quickly because of these excess
// bytes for the struct.
//
// For instance, seq 0..20000 > ...text = 108894 bytes
// But overhead is 1920000 + 108894 = 2028894 bytes
//
// Or kjvbible-random.txt = 4332506 bytes, but minimum size of its
// Or kjvbible-random.txt = 4332506 bytes, but minimum size of its
// 99817 lines in memory * 96 bytes = 9582432 bytes
//
// Here, we test 108894 bytes with a 50K buffer
@ -59,7 +59,7 @@ fn test_human_numeric_whitespace() {
test_helper("human-numeric-whitespace", "-h");
}
// This tests where serde often fails when reading back JSON
// This tests where serde often fails when reading back JSON
// if it finds a null value
#[test]
fn test_extsort_as64_bailout() {

View file

@ -224,8 +224,14 @@ fn test_size_and_reference() {
let mut file1 = at.make_file(TFILE1);
let mut file2 = at.make_file(TFILE2);
file1.write_all(b"1234567890").unwrap();
ucmd.args(&["--reference", TFILE1, "--size", "+5", TFILE2]).succeeds();
ucmd.args(&["--reference", TFILE1, "--size", "+5", TFILE2])
.succeeds();
file2.seek(SeekFrom::End(0)).unwrap();
let actual = file2.seek(SeekFrom::Current(0)).unwrap();
assert!(expected == actual, "expected '{}' got '{}'", expected, actual);
assert!(
expected == actual,
"expected '{}' got '{}'",
expected,
actual
);
}