Skip to content

Commit

Permalink
Merge pull request #23 from matagus/tests-for-multiple-files-and-stdin
Browse files Browse the repository at this point in the history
Tests for multiple files and stdin
  • Loading branch information
matagus authored Sep 23, 2024
2 parents 74b5970 + 67b2555 commit 63a1e70
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use assert_cmd::Command;
use predicates::prelude::*;
use std::fs;

type TestResult = Result<(), Box<dyn std::error::Error>>;
Expand Down Expand Up @@ -65,3 +64,16 @@ fn test_4th_column() -> TestResult {
"tests/expected/column-4.txt",
)
}

#[test]
fn test_tw0_files() -> TestResult {
run(
&[
"-c",
"4",
"tests/inputs/tasks.csv",
"tests/inputs/more-tasks.csv",
],
"tests/expected/two-files.txt",
)
}
20 changes: 20 additions & 0 deletions tests/expected/two-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
High:

1, Implement feature A, In Progress, John Doe, High
4, Refactor code, To Do, Jane Doe, High
7, Fix bug C, To Do, Alice Bar, High
9, Another feature, To Do, Jane Doe, High
11, Periodic maintenance, To Do, Jane Doe, High

Low:

2, Fix bug B, Done, Jane Doe, Low
5, Deploy to production A and B, To Do, John Doe, Low
8, Write tests for feature A, In Progress, John Doe, Low
10, Another bug, To Do, John Doe, Low

Medium:

3, Write tests for feature A, In Progress, John Doe, Medium
6, Write missing documentation for feature A, Done, Peter Foo, Medium

4 changes: 4 additions & 0 deletions tests/inputs/more-tasks.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ID,Title,Status,Assignee,Priority
9,Another feature,To Do,Jane Doe,High
10,Another bug,To Do,John Doe,Low
11,Periodic maintenance,To Do,Jane Doe,High

0 comments on commit 63a1e70

Please sign in to comment.