From ff6f6d4c3de1a14c6b2ebef270c0ec542300f0de Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Fri, 10 Apr 2020 17:09:49 -0700 Subject: [PATCH] Test that `--glob`s match entire file paths E.g. `--glob x*` matches `x/y`. type: testing pr: https://github.com/casey/intermodal/pull/357 --- CHANGELOG.md | 8 +++++++- src/subcommand/torrent/create.rs | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 722dc5b..46224c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ Changelog ========= +UNRELEASED - 2020-04-11 +----------------------- +- :white_check_mark: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Test that `--glob`s match entire file paths ([#357](https://github.com/casey/intermodal/pull/357)) - _Casey Rodarmor _ +- :books: [`b914c175949f`](https://github.com/casey/intermodal/commit/b914c175949fa6063b6fb0428f4ebd66a51fdda3) Add buildtorretn to prior art section of book ([#355](https://github.com/casey/intermodal/pull/355)) - _Casey Rodarmor _ + + [v0.1.4](https://github.com/casey/intermodal/releases/tag/v0.1.4) - 2020-04-10 ------------------------------------------------------------------------------ -- :bookmark: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Release v0.1.4 ([#354](https://github.com/casey/intermodal/pull/354)) - _Casey Rodarmor _ +- :bookmark: [`f070c62b12f5`](https://github.com/casey/intermodal/commit/f070c62b12f55909c62d461095605f096715b475) Release v0.1.4 ([#354](https://github.com/casey/intermodal/pull/354)) - _Casey Rodarmor _ - :bug: [`4dfe537fa515`](https://github.com/casey/intermodal/commit/4dfe537fa515186a6fc65485c6bea16ccd611231) Prevent progress bar from overflowing ([#353](https://github.com/casey/intermodal/pull/353)) - _Casey Rodarmor _ - :package: [`a67eb72848c9`](https://github.com/casey/intermodal/commit/a67eb72848c9f30513fde2849e1f07a332931e6c) Improve install.sh and documentation ([#352](https://github.com/casey/intermodal/pull/352)) - _Casey Rodarmor _ - :art: [`e54bdeb95d93`](https://github.com/casey/intermodal/commit/e54bdeb95d932bd5f81870f34999de37b615a69d) Remove use of unreachable in favor of internal errors ([#351](https://github.com/casey/intermodal/pull/351)) - Fixes [#188](https://github.com/casey/intermodal/issues/188) - _Casey Rodarmor _ diff --git a/src/subcommand/torrent/create.rs b/src/subcommand/torrent/create.rs index ab168fa..720cfb3 100644 --- a/src/subcommand/torrent/create.rs +++ b/src/subcommand/torrent/create.rs @@ -2083,6 +2083,38 @@ Content Size 9 bytes assert_eq!(metainfo.info.pieces, PieceList::new()); } + #[test] + fn glob_entire_path() { + let mut env = test_env! { + args: [ + "torrent", + "create", + "--input", + "foo", + "--announce", + "http://bar", + "--glob", + "x*", + ], + tree: { + foo: { + a: "a", + x: { + y: "yyy", + }, + c: "c", + }, + } + }; + env.assert_ok(); + let metainfo = env.load_metainfo("foo.torrent"); + assert_matches!( + metainfo.info.mode, + Mode::Multiple { files } if files.len() == 1 + ); + assert_eq!(metainfo.info.pieces, PieceList::from_pieces(&["yyy"])); + } + #[test] fn glob_precedence() { let mut env = test_env! {