mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:25:38 +02:00
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:
@ -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,
|
||||
),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user