Another batch of command tests (#4496)

* Add a batch of command tests

* More tests
This commit is contained in:
JT
2022-02-16 07:38:02 -05:00
committed by GitHub
parent 644435bfe3
commit c4e1559f89
13 changed files with 43 additions and 70 deletions

View File

@ -290,6 +290,7 @@ impl Value {
pub fn as_float(&self) -> Result<f64, ShellError> {
match self {
Value::Float { val, .. } => Ok(*val),
Value::Int { val, .. } => Ok(*val as f64),
x => Err(ShellError::CantConvert(
"float".into(),
x.get_type().to_string(),

View File

@ -109,8 +109,7 @@ impl Range {
self.from <= self.to
}
#[inline]
fn is_end_inclusive(&self) -> bool {
pub fn is_end_inclusive(&self) -> bool {
matches!(self.inclusion, RangeInclusion::Inclusive)
}