Add initial nu-test-support port (#913)

* Add initial nu-test-support port

* finish changing binary name

* Oops, these aren't Windows-safe tests
This commit is contained in:
JT
2022-02-02 15:59:01 -05:00
committed by GitHub
parent cbdc0e2010
commit cc1b784e3d
169 changed files with 7276 additions and 56 deletions

View File

@ -1028,13 +1028,25 @@ fn compute(size: i64, unit: Unit, span: Span) -> Value {
val: size * 1000 * 1000 * 1000 * 60 * 60,
span,
},
Unit::Day => Value::Duration {
val: size * 1000 * 1000 * 1000 * 60 * 60 * 24,
span,
Unit::Day => match size.checked_mul(1000 * 1000 * 1000 * 60 * 60 * 24) {
Some(val) => Value::Duration { val, span },
None => Value::Error {
error: ShellError::SpannedLabeledError(
"duration too large".into(),
"duration too large".into(),
span,
),
},
},
Unit::Week => Value::Duration {
val: size * 1000 * 1000 * 1000 * 60 * 60 * 24 * 7,
span,
Unit::Week => match size.checked_mul(1000 * 1000 * 1000 * 60 * 60 * 24 * 7) {
Some(val) => Value::Duration { val, span },
None => Value::Error {
error: ShellError::SpannedLabeledError(
"duration too large".into(),
"duration too large".into(),
span,
),
},
},
}
}