-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Moved extract files in RsTestData * Base implementation without test * MVP completed and test example in playground * Make values creation more testable * Revert "Implemented arguments's files parsing" This reverts commit 6a197fd. * Update rstest requirement from 0.16.0 to 0.17.0 (#192) Updates the requirements on [rstest](https://github.com/la10736/rstest) to permit the latest version. - [Release notes](https://github.com/la10736/rstest/releases) - [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md) - [Commits](0.16.0...0.17.0) --- updated-dependencies: - dependency-name: rstest dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix #189 * Call visit_item_fn_mut in a custom visit_item_fn_mut can cause wired behavior because it will also visit inner functions. A clean solution to #189 is to take the responsibility of the two extraction separated. Also we removed the inner visit_item_fn_mut for all others extractions because are useless and can cause also wired bugs * Update changelog * Prepare new version * Make values creation more testable * Missed mod files in rebase * Fix imports * Refactor for testing * Coverage all errors * Introduce exclude parsing * Implemented filter * fix README.md (#194) (cherry picked from commit 4378e0e) * Fixed tests for last rust version * Use relative path to make regex cross platform * Introduce logic to accept or reject dot files * Implement sort and multiple glob (missed parsing) * Implemented support for more exclude * Implement parsing new syntax (include_dot_files and multiple files and exclude attributes). Tests about new syntax and error. Missed: - error should point attributes and not arguments - Docs - Refactoring (clean code) - Test E2E - Change log * Now error point to attributes * Refactor * Refactor * Add licenses (#196) Symlink license files from the parent directory so that crates are created with them. Needed for distribution especially for the MIT license. Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org> * Fixed docs: example in wrong section * Docs * Changelog * E2E test * Move tests on sanitize_ident near to implementation --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kenkoooo <kenkou.n@gmail.com> Co-authored-by: Michel Alexandre Salim <michel@michel-slm.name>
- Loading branch information
1 parent
7b5e422
commit 0399a31
Showing
21 changed files
with
1,011 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
// Usare IntelliSense per informazioni sui possibili attributi. | ||
// Al passaggio del mouse vengono visualizzate le descrizioni degli attributi esistenti. | ||
// Per altre informazioni, visitare: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug integration test 'acceptance'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--test=acceptance", | ||
"--package=rstest_reuse" | ||
], | ||
"filter": { | ||
"name": "acceptance", | ||
"kind": "test" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in library 'rstest_test'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--lib", | ||
"--package=rstest_test" | ||
], | ||
"filter": { | ||
"name": "rstest_test", | ||
"kind": "lib" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug integration test 'framework'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--test=framework", | ||
"--package=rstest_test" | ||
], | ||
"filter": { | ||
"name": "framework", | ||
"kind": "test" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug integration test 'macros'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--test=macros", | ||
"--package=rstest_test" | ||
], | ||
"filter": { | ||
"name": "macros", | ||
"kind": "test" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in library 'rstest'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--lib", | ||
"--package=rstest" | ||
], | ||
"filter": { | ||
"name": "rstest", | ||
"kind": "lib" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug integration test 'integration'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--test=integration", | ||
"--package=rstest" | ||
], | ||
"filter": { | ||
"name": "integration", | ||
"kind": "test" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
myname.txt | ||
|
||
|
||
something else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
no test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
something else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,14 @@ | ||
use rstest::*; | ||
|
||
#[fixture] | ||
#[awt] | ||
async fn two_args_mix_fixture( | ||
#[future] | ||
#[default(async { 4 })] | ||
four: u32, | ||
#[default(2)] two: u32, | ||
) -> u32 { | ||
four * 10 + two | ||
} | ||
|
||
// #[rstest] | ||
// #[awt] | ||
// async fn use_two_args_mix_fixture(#[future] two_args_mix_fixture: u32) { | ||
// assert_eq!(42, two_args_mix_fixture); | ||
// } | ||
|
||
// #[rstest] | ||
// #[awt] | ||
// async fn use_two_args_mix_fixture_inject_first( | ||
// #[future] | ||
// #[with(async { 5 })] | ||
// two_args_mix_fixture: u32, | ||
// ) { | ||
// assert_eq!(52, two_args_mix_fixture); | ||
// } | ||
use std::fs::File; | ||
use std::path::PathBuf; | ||
use std::io::Read; | ||
|
||
#[rstest] | ||
#[awt] | ||
async fn use_two_args_mix_fixture_inject_both( | ||
#[future] | ||
#[with(async { 3 }, 1)] | ||
two_args_mix_fixture: u32, | ||
) { | ||
assert_eq!(31, two_args_mix_fixture); | ||
} | ||
fn start_with_name(#[files("files/*.txt")] path: PathBuf) { | ||
let name = path.file_name().unwrap(); | ||
let mut f = File::open(&path).unwrap(); | ||
let mut contents = String::new(); | ||
f.read_to_string(&mut contents).unwrap(); | ||
|
||
assert!(contents.starts_with(name.to_str().unwrap())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use rstest::*; | ||
use std::fs::File; | ||
use std::io::Read; | ||
use std::path::PathBuf; | ||
|
||
#[rstest] | ||
fn start_with_name( | ||
#[files("files/**/*.txt")] | ||
#[exclude("exclude")] | ||
path: PathBuf, | ||
) { | ||
let name = path.file_name().unwrap(); | ||
let mut f = File::open(&path).unwrap(); | ||
let mut contents = String::new(); | ||
f.read_to_string(&mut contents).unwrap(); | ||
|
||
assert!(contents.starts_with(name.to_str().unwrap())) | ||
} | ||
|
||
#[rstest] | ||
fn start_with_name_with_include( | ||
#[files("files/**/*.txt")] | ||
#[exclude("exclude")] | ||
#[include_dot_files] | ||
path: PathBuf, | ||
) { | ||
let name = path.file_name().unwrap(); | ||
let mut f = File::open(&path).unwrap(); | ||
let mut contents = String::new(); | ||
f.read_to_string(&mut contents).unwrap(); | ||
|
||
assert!(contents.starts_with(name.to_str().unwrap())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.