Merge pull request #464 from djc/fmt

Fix formatting with cargo fmt
This commit is contained in:
Jonathan Turner 2019-08-27 07:12:18 +12:00 committed by GitHub
commit ca11dc2031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 148 additions and 181 deletions

View file

@ -35,8 +35,8 @@ crate mod pick;
crate mod plugin; crate mod plugin;
crate mod prev; crate mod prev;
crate mod ps; crate mod ps;
crate mod reverse;
crate mod reject; crate mod reject;
crate mod reverse;
crate mod rm; crate mod rm;
crate mod save; crate mod save;
crate mod shells; crate mod shells;

View file

@ -2,7 +2,7 @@ use crate::commands::WholeStreamCommand;
use crate::object::base::OF64; use crate::object::base::OF64;
use crate::object::{Primitive, TaggedDictBuilder, Value}; use crate::object::{Primitive, TaggedDictBuilder, Value};
use crate::prelude::*; use crate::prelude::*;
use bson::{decode_document, Bson, spec::BinarySubtype}; use bson::{decode_document, spec::BinarySubtype, Bson};
pub struct FromBSON; pub struct FromBSON;
@ -47,71 +47,72 @@ fn convert_bson_value_to_nu_value(v: &Bson, tag: impl Into<Tag>) -> Tagged<Value
Bson::Boolean(b) => Value::Primitive(Primitive::Boolean(*b)).tagged(tag), Bson::Boolean(b) => Value::Primitive(Primitive::Boolean(*b)).tagged(tag),
Bson::Null => Value::Primitive(Primitive::String(String::from(""))).tagged(tag), Bson::Null => Value::Primitive(Primitive::String(String::from(""))).tagged(tag),
Bson::RegExp(r, opts) => { Bson::RegExp(r, opts) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$regex".to_string(), "$regex".to_string(),
Value::Primitive(Primitive::String(String::from(r))).tagged(tag), Value::Primitive(Primitive::String(String::from(r))).tagged(tag),
); );
collected.insert_tagged( collected.insert_tagged(
"$options".to_string(), "$options".to_string(),
Value::Primitive(Primitive::String(String::from(opts))).tagged(tag), Value::Primitive(Primitive::String(String::from(opts))).tagged(tag),
); );
collected.into_tagged_value() collected.into_tagged_value()
} }
Bson::I32(n) => Value::Primitive(Primitive::Int(*n as i64)).tagged(tag), Bson::I32(n) => Value::Primitive(Primitive::Int(*n as i64)).tagged(tag),
Bson::I64(n) => Value::Primitive(Primitive::Int(*n as i64)).tagged(tag), Bson::I64(n) => Value::Primitive(Primitive::Int(*n as i64)).tagged(tag),
Bson::JavaScriptCode(js) => { Bson::JavaScriptCode(js) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$javascript".to_string(), "$javascript".to_string(),
Value::Primitive(Primitive::String(String::from(js))).tagged(tag), Value::Primitive(Primitive::String(String::from(js))).tagged(tag),
); );
collected.into_tagged_value() collected.into_tagged_value()
} }
Bson::JavaScriptCodeWithScope(js, doc) => { Bson::JavaScriptCodeWithScope(js, doc) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$javascript".to_string(), "$javascript".to_string(),
Value::Primitive(Primitive::String(String::from(js))).tagged(tag), Value::Primitive(Primitive::String(String::from(js))).tagged(tag),
); );
collected.insert_tagged( collected.insert_tagged(
"$scope".to_string(), "$scope".to_string(),
convert_bson_value_to_nu_value(&Bson::Document(doc.to_owned()), tag), convert_bson_value_to_nu_value(&Bson::Document(doc.to_owned()), tag),
); );
collected.into_tagged_value() collected.into_tagged_value()
} }
Bson::TimeStamp(ts) => { Bson::TimeStamp(ts) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$timestamp".to_string(), "$timestamp".to_string(),
Value::Primitive(Primitive::Int(*ts as i64)).tagged(tag), Value::Primitive(Primitive::Int(*ts as i64)).tagged(tag),
); );
collected.into_tagged_value() collected.into_tagged_value()
} }
Bson::Binary(bst, bytes) => { Bson::Binary(bst, bytes) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$binary_subtype".to_string(), "$binary_subtype".to_string(),
match bst { match bst {
BinarySubtype::UserDefined(u) => Value::Primitive(Primitive::Int(*u as i64)), BinarySubtype::UserDefined(u) => Value::Primitive(Primitive::Int(*u as i64)),
_ => Value::Primitive(Primitive::String(binary_subtype_to_string(*bst))), _ => Value::Primitive(Primitive::String(binary_subtype_to_string(*bst))),
}.tagged(tag) }
); .tagged(tag),
collected.insert_tagged( );
"$binary".to_string(), collected.insert_tagged(
Value::Binary(bytes.to_owned()).tagged(tag), "$binary".to_string(),
); Value::Binary(bytes.to_owned()).tagged(tag),
collected.into_tagged_value() );
collected.into_tagged_value()
} }
Bson::ObjectId(obj_id) => Value::Primitive(Primitive::String(obj_id.to_hex())).tagged(tag), Bson::ObjectId(obj_id) => Value::Primitive(Primitive::String(obj_id.to_hex())).tagged(tag),
Bson::UtcDatetime(dt) => Value::Primitive(Primitive::Date(*dt)).tagged(tag), Bson::UtcDatetime(dt) => Value::Primitive(Primitive::Date(*dt)).tagged(tag),
Bson::Symbol(s) => { Bson::Symbol(s) => {
let mut collected = TaggedDictBuilder::new(tag); let mut collected = TaggedDictBuilder::new(tag);
collected.insert_tagged( collected.insert_tagged(
"$symbol".to_string(), "$symbol".to_string(),
Value::Primitive(Primitive::String(String::from(s))).tagged(tag), Value::Primitive(Primitive::String(String::from(s))).tagged(tag),
); );
collected.into_tagged_value() collected.into_tagged_value()
} }
} }
} }
@ -125,7 +126,8 @@ fn binary_subtype_to_string(bst: BinarySubtype) -> String {
BinarySubtype::Uuid => "uuid", BinarySubtype::Uuid => "uuid",
BinarySubtype::Md5 => "md5", BinarySubtype::Md5 => "md5",
_ => unreachable!(), _ => unreachable!(),
}.to_string() }
.to_string()
} }
#[derive(Debug)] #[derive(Debug)]

View file

@ -44,7 +44,7 @@ fn last(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, S
"Value is too low", "Value is too low",
"expected a positive integer", "expected a positive integer",
args.expect_nth(0)?.span(), args.expect_nth(0)?.span(),
)) ));
} }
let stream = async_stream_block! { let stream = async_stream_block! {

View file

@ -426,14 +426,16 @@ pub fn parse_string_as_value(
name_span: Span, name_span: Span,
) -> Result<Tagged<Value>, ShellError> { ) -> Result<Tagged<Value>, ShellError> {
match extension { match extension {
Some(x) if x == "csv" => crate::commands::from_csv::from_csv_string_to_value( Some(x) if x == "csv" => {
contents, crate::commands::from_csv::from_csv_string_to_value(contents, false, contents_tag)
false, .map_err(move |_| {
contents_tag, ShellError::labeled_error(
) "Could not open as CSV",
.map_err(move |_| { "could not open as CSV",
ShellError::labeled_error("Could not open as CSV", "could not open as CSV", name_span) name_span,
}), )
})
}
Some(x) if x == "toml" => { Some(x) if x == "toml" => {
crate::commands::from_toml::from_toml_string_to_value(contents, contents_tag).map_err( crate::commands::from_toml::from_toml_string_to_value(contents, contents_tag).map_err(
move |_| { move |_| {
@ -507,9 +509,9 @@ pub fn parse_binary_as_value(
crate::commands::from_bson::from_bson_bytes_to_value(contents, contents_tag).map_err( crate::commands::from_bson::from_bson_bytes_to_value(contents, contents_tag).map_err(
move |_| { move |_| {
ShellError::labeled_error( ShellError::labeled_error(
"Could not open as BSON", "Could not open as BSON",
"could not open as BSON", "could not open as BSON",
name_span, name_span,
) )
}, },
) )

View file

@ -46,9 +46,7 @@ fn sort_by(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream
.collect::<Vec<Option<Tagged<Value>>>>() .collect::<Vec<Option<Tagged<Value>>>>()
}; };
if reverse { if reverse {
vec.sort_by_cached_key(|item| { vec.sort_by_cached_key(|item| std::cmp::Reverse(calc_key(item)));
std::cmp::Reverse(calc_key(item))
});
} else { } else {
vec.sort_by_cached_key(calc_key); vec.sort_by_cached_key(calc_key);
} }

View file

@ -7,15 +7,13 @@ pub fn current_branch() -> Option<String> {
Ok(repo) => { Ok(repo) => {
let r = repo.head(); let r = repo.head();
match r { match r {
Ok(r) => { Ok(r) => match r.shorthand() {
match r.shorthand() { Some(s) => Some(s.to_string()),
Some(s) => Some(s.to_string()), None => None,
None => None,
}
}, },
_ => None _ => None,
} }
}, }
_ => None _ => None,
} }
} }

View file

@ -122,10 +122,8 @@ impl Primitive {
pub fn style(&self) -> &'static str { pub fn style(&self) -> &'static str {
match self { match self {
Primitive::Bytes(0) => "c", // centre 'missing' indicator Primitive::Bytes(0) => "c", // centre 'missing' indicator
Primitive::Int(_) | Primitive::Int(_) | Primitive::Bytes(_) | Primitive::Float(_) => "r",
Primitive::Bytes(_) | _ => "",
Primitive::Float(_) => "r",
_ => ""
} }
} }
} }
@ -472,7 +470,7 @@ impl Value {
crate fn style_leaf(&self) -> &'static str { crate fn style_leaf(&self) -> &'static str {
match self { match self {
Value::Primitive(p) => p.style(), Value::Primitive(p) => p.style(),
_ => "" _ => "",
} }
} }

View file

@ -105,7 +105,10 @@ impl FileStructure {
self.root = path.to_path_buf(); self.root = path.to_path_buf();
} }
pub fn paths_applying_with<F>(&mut self, to: F) -> Result<Vec<(PathBuf, PathBuf)>, Box<dyn std::error::Error>> pub fn paths_applying_with<F>(
&mut self,
to: F,
) -> Result<Vec<(PathBuf, PathBuf)>, Box<dyn std::error::Error>>
where where
F: Fn((PathBuf, usize)) -> Result<(PathBuf, PathBuf), Box<dyn std::error::Error>>, F: Fn((PathBuf, usize)) -> Result<(PathBuf, PathBuf), Box<dyn std::error::Error>>,
{ {
@ -175,7 +178,8 @@ mod tests {
fn prepares_and_decorates_source_files_for_copying() { fn prepares_and_decorates_source_files_for_copying() {
let mut res = FileStructure::new(); let mut res = FileStructure::new();
res.walk_decorate(fixtures().as_path()).expect("Can not decorate files traversal."); res.walk_decorate(fixtures().as_path())
.expect("Can not decorate files traversal.");
assert_eq!( assert_eq!(
res.resources, res.resources,

View file

@ -8,15 +8,13 @@ use std::path::{Path, PathBuf};
#[test] #[test]
fn moves_a_file() { fn moves_a_file() {
let sandbox = Playground::setup_for("mv_test_1") let sandbox = Playground::setup_for("mv_test_1")
.with_files(vec![ .with_files(vec![EmptyFile("andres.txt")])
EmptyFile("andres.txt"),
])
.mkdir("expected") .mkdir("expected")
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original = format!("{}/{}", full_path, "andres.txt"); let original = format!("{}/{}", full_path, "andres.txt");
let expected = format!("{}/{}", full_path, "expected/yehuda.txt"); let expected = format!("{}/{}", full_path, "expected/yehuda.txt");
nu!( nu!(
_output, _output,
@ -31,21 +29,14 @@ fn moves_a_file() {
#[test] #[test]
fn overwrites_if_moving_to_existing_file() { fn overwrites_if_moving_to_existing_file() {
let sandbox = Playground::setup_for("mv_test_2") let sandbox = Playground::setup_for("mv_test_2")
.with_files(vec![ .with_files(vec![EmptyFile("andres.txt"), EmptyFile("jonathan.txt")])
EmptyFile("andres.txt"),
EmptyFile("jonathan.txt"),
])
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original = format!("{}/{}", full_path, "andres.txt"); let original = format!("{}/{}", full_path, "andres.txt");
let expected = format!("{}/{}", full_path, "jonathan.txt"); let expected = format!("{}/{}", full_path, "jonathan.txt");
nu!( nu!(_output, cwd(&full_path), "mv andres.txt jonathan.txt");
_output,
cwd(&full_path),
"mv andres.txt jonathan.txt"
);
assert!(!h::file_exists_at(PathBuf::from(original))); assert!(!h::file_exists_at(PathBuf::from(original)));
assert!(h::file_exists_at(PathBuf::from(expected))); assert!(h::file_exists_at(PathBuf::from(expected)));
@ -58,14 +49,10 @@ fn moves_a_directory() {
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original_dir = format!("{}/{}", full_path, "empty_dir"); let original_dir = format!("{}/{}", full_path, "empty_dir");
let expected = format!("{}/{}", full_path, "renamed_dir"); let expected = format!("{}/{}", full_path, "renamed_dir");
nu!( nu!(_output, cwd(&full_path), "mv empty_dir renamed_dir");
_output,
cwd(&full_path),
"mv empty_dir renamed_dir"
);
assert!(!h::dir_exists_at(PathBuf::from(original_dir))); assert!(!h::dir_exists_at(PathBuf::from(original_dir)));
assert!(h::dir_exists_at(PathBuf::from(expected))); assert!(h::dir_exists_at(PathBuf::from(expected)));
@ -74,22 +61,15 @@ fn moves_a_directory() {
#[test] #[test]
fn moves_the_file_inside_directory_if_path_to_move_is_existing_directory() { fn moves_the_file_inside_directory_if_path_to_move_is_existing_directory() {
let sandbox = Playground::setup_for("mv_test_4") let sandbox = Playground::setup_for("mv_test_4")
.with_files(vec![ .with_files(vec![EmptyFile("jonathan.txt")])
EmptyFile("jonathan.txt"),
])
.mkdir("expected") .mkdir("expected")
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original_dir = format!("{}/{}", full_path, "jonathan.txt"); let original_dir = format!("{}/{}", full_path, "jonathan.txt");
let expected = format!("{}/{}", full_path, "expected/jonathan.txt"); let expected = format!("{}/{}", full_path, "expected/jonathan.txt");
nu!(
_output,
cwd(&full_path),
"mv jonathan.txt expected"
);
nu!(_output, cwd(&full_path), "mv jonathan.txt expected");
assert!(!h::file_exists_at(PathBuf::from(original_dir))); assert!(!h::file_exists_at(PathBuf::from(original_dir)));
assert!(h::file_exists_at(PathBuf::from(expected))); assert!(h::file_exists_at(PathBuf::from(expected)));
@ -99,22 +79,15 @@ fn moves_the_file_inside_directory_if_path_to_move_is_existing_directory() {
fn moves_the_directory_inside_directory_if_path_to_move_is_existing_directory() { fn moves_the_directory_inside_directory_if_path_to_move_is_existing_directory() {
let sandbox = Playground::setup_for("mv_test_5") let sandbox = Playground::setup_for("mv_test_5")
.within("contributors") .within("contributors")
.with_files(vec![ .with_files(vec![EmptyFile("jonathan.txt")])
EmptyFile("jonathan.txt"),
])
.mkdir("expected") .mkdir("expected")
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original_dir = format!("{}/{}", full_path, "contributors"); let original_dir = format!("{}/{}", full_path, "contributors");
let expected = format!("{}/{}", full_path, "expected/contributors"); let expected = format!("{}/{}", full_path, "expected/contributors");
nu!(
_output,
cwd(&full_path),
"mv contributors expected"
);
nu!(_output, cwd(&full_path), "mv contributors expected");
assert!(!h::dir_exists_at(PathBuf::from(original_dir))); assert!(!h::dir_exists_at(PathBuf::from(original_dir)));
assert!(h::file_exists_at(PathBuf::from(expected))); assert!(h::file_exists_at(PathBuf::from(expected)));
@ -124,14 +97,12 @@ fn moves_the_directory_inside_directory_if_path_to_move_is_existing_directory()
fn moves_the_directory_inside_directory_if_path_to_move_is_nonexistent_directory() { fn moves_the_directory_inside_directory_if_path_to_move_is_nonexistent_directory() {
let sandbox = Playground::setup_for("mv_test_6") let sandbox = Playground::setup_for("mv_test_6")
.within("contributors") .within("contributors")
.with_files(vec![ .with_files(vec![EmptyFile("jonathan.txt")])
EmptyFile("jonathan.txt"),
])
.mkdir("expected") .mkdir("expected")
.test_dir_name(); .test_dir_name();
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
let original_dir = format!("{}/{}", full_path, "contributors"); let original_dir = format!("{}/{}", full_path, "contributors");
nu!( nu!(
_output, _output,
@ -139,7 +110,10 @@ fn moves_the_directory_inside_directory_if_path_to_move_is_nonexistent_directory
"mv contributors expected/this_dir_exists_now/los_tres_amigos" "mv contributors expected/this_dir_exists_now/los_tres_amigos"
); );
let expected = format!("{}/{}", full_path, "expected/this_dir_exists_now/los_tres_amigos"); let expected = format!(
"{}/{}",
full_path, "expected/this_dir_exists_now/los_tres_amigos"
);
assert!(!h::dir_exists_at(PathBuf::from(original_dir))); assert!(!h::dir_exists_at(PathBuf::from(original_dir)));
assert!(h::file_exists_at(PathBuf::from(expected))); assert!(h::file_exists_at(PathBuf::from(expected)));
@ -168,11 +142,7 @@ fn moves_using_path_with_wildcard() {
let work_dir = format!("{}/{}", full_path, "work_dir"); let work_dir = format!("{}/{}", full_path, "work_dir");
let expected_copies_path = format!("{}/{}", full_path, "expected"); let expected_copies_path = format!("{}/{}", full_path, "expected");
nu!( nu!(_output, cwd(&work_dir), "mv ../originals/*.ini ../expected");
_output,
cwd(&work_dir),
"mv ../originals/*.ini ../expected"
);
assert!(h::files_exist_at( assert!(h::files_exist_at(
vec![ vec![
@ -185,7 +155,6 @@ fn moves_using_path_with_wildcard() {
)); ));
} }
#[test] #[test]
fn moves_using_a_glob() { fn moves_using_a_glob() {
let sandbox = Playground::setup_for("mv_test_8") let sandbox = Playground::setup_for("mv_test_8")
@ -204,11 +173,7 @@ fn moves_using_a_glob() {
let work_dir = format!("{}/{}", full_path, "work_dir"); let work_dir = format!("{}/{}", full_path, "work_dir");
let expected_copies_path = format!("{}/{}", full_path, "expected"); let expected_copies_path = format!("{}/{}", full_path, "expected");
nu!( nu!(_output, cwd(&work_dir), "mv ../meals/* ../expected");
_output,
cwd(&work_dir),
"mv ../meals/* ../expected"
);
assert!(h::dir_exists_at(PathBuf::from(meal_dir))); assert!(h::dir_exists_at(PathBuf::from(meal_dir)));
assert!(h::files_exist_at( assert!(h::files_exist_at(

View file

@ -98,10 +98,7 @@ fn rm_removes_deeply_nested_directories_with_wildcard_and_recursive_flag() {
); );
assert!(!h::files_exist_at( assert!(!h::files_exist_at(
vec![ vec![Path::new("src/parser/parse"), Path::new("src/parser/hir"),],
Path::new("src/parser/parse"),
Path::new("src/parser/hir"),
],
PathBuf::from(&full_path) PathBuf::from(&full_path)
)); ));
} }
@ -150,7 +147,11 @@ fn rm_errors_if_attempting_to_delete_a_directory_with_content_without_recursive_
let full_path = format!("{}/{}", Playground::root(), sandbox); let full_path = format!("{}/{}", Playground::root(), sandbox);
nu_error!(output, cwd(&Playground::root()), "rm rm_prevent_directory_removal_without_flag_test"); nu_error!(
output,
cwd(&Playground::root()),
"rm rm_prevent_directory_removal_without_flag_test"
);
assert!(h::file_exists_at(PathBuf::from(full_path))); assert!(h::file_exists_at(PathBuf::from(full_path)));
assert!(output.contains("is a directory")); assert!(output.contains("is a directory"));

View file

@ -16,14 +16,15 @@ fn can_only_apply_one() {
#[test] #[test]
fn by_one_with_field_passed() { fn by_one_with_field_passed() {
Playground::setup_for("plugin_inc_by_one_with_field_passed_test") Playground::setup_for("plugin_inc_by_one_with_field_passed_test").with_files(vec![
.with_files(vec![FileWithContent( FileWithContent(
"sample.toml", "sample.toml",
r#" r#"
[package] [package]
edition = "2018" edition = "2018"
"#, "#,
)]); ),
]);
nu!( nu!(
output, output,
@ -36,14 +37,15 @@ fn by_one_with_field_passed() {
#[test] #[test]
fn by_one_with_no_field_passed() { fn by_one_with_no_field_passed() {
Playground::setup_for("plugin_inc_by_one_with_no_field_passed_test") Playground::setup_for("plugin_inc_by_one_with_no_field_passed_test").with_files(vec![
.with_files(vec![FileWithContent( FileWithContent(
"sample.toml", "sample.toml",
r#" r#"
[package] [package]
contributors = "2" contributors = "2"
"#, "#,
)]); ),
]);
nu!( nu!(
output, output,
@ -54,17 +56,15 @@ fn by_one_with_no_field_passed() {
assert_eq!(output, "3"); assert_eq!(output, "3");
} }
#[test] #[test]
fn semversion_major_inc() { fn semversion_major_inc() {
Playground::setup_for("plugin_inc_major_semversion_test") Playground::setup_for("plugin_inc_major_semversion_test").with_files(vec![FileWithContent(
.with_files(vec![FileWithContent( "sample.toml",
"sample.toml", r#"
r#"
[package] [package]
version = "0.1.3" version = "0.1.3"
"#, "#,
)]); )]);
nu!( nu!(
output, output,
@ -77,14 +77,13 @@ fn semversion_major_inc() {
#[test] #[test]
fn semversion_minor_inc() { fn semversion_minor_inc() {
Playground::setup_for("plugin_inc_minor_semversion_test") Playground::setup_for("plugin_inc_minor_semversion_test").with_files(vec![FileWithContent(
.with_files(vec![FileWithContent( "sample.toml",
"sample.toml", r#"
r#"
[package] [package]
version = "0.1.3" version = "0.1.3"
"#, "#,
)]); )]);
nu!( nu!(
output, output,
@ -97,14 +96,13 @@ fn semversion_minor_inc() {
#[test] #[test]
fn semversion_patch_inc() { fn semversion_patch_inc() {
Playground::setup_for("plugin_inc_patch_semversion_test") Playground::setup_for("plugin_inc_patch_semversion_test").with_files(vec![FileWithContent(
.with_files(vec![FileWithContent( "sample.toml",
"sample.toml", r#"
r#"
[package] [package]
version = "0.1.3" version = "0.1.3"
"#, "#,
)]); )]);
nu!( nu!(
output, output,
@ -117,14 +115,15 @@ fn semversion_patch_inc() {
#[test] #[test]
fn semversion_without_passing_field() { fn semversion_without_passing_field() {
Playground::setup_for("plugin_inc_semversion_without_passing_field_test") Playground::setup_for("plugin_inc_semversion_without_passing_field_test").with_files(vec![
.with_files(vec![FileWithContent( FileWithContent(
"sample.toml", "sample.toml",
r#" r#"
[package] [package]
version = "0.1.3" version = "0.1.3"
"#, "#,
)]); ),
]);
nu!( nu!(
output, output,