Skip to content

Commit

Permalink
Expand boolean query tests
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Feb 9, 2024
1 parent d392b24 commit df73174
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions tests/functional/filter/cram/filter-query-boolean.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Setup

$ source "$TESTDIR"/_setup.sh

Create metadata file for testing.
A column with True and False values is query-able by boolean comparisons.

$ cat >metadata.tsv <<~~
> strain column
Expand All @@ -11,8 +11,6 @@ Create metadata file for testing.
> SEQ_3 False
> ~~

The column is query-able by boolean comparisons.

$ ${AUGUR} filter \
> --metadata metadata.tsv \
> --query "column == True" \
Expand All @@ -24,3 +22,44 @@ The column is query-able by boolean comparisons.
$ sort filtered_strains.txt
SEQ_1
SEQ_2

Empty values are ignored.

$ cat >metadata.tsv <<~~
> strain column
> SEQ_1 True
> SEQ_2 False
> SEQ_3
> ~~

$ ${AUGUR} filter \
> --metadata metadata.tsv \
> --query "column == True" \
> --output-strains filtered_strains.txt
2 strains were dropped during filtering
2 were filtered out by the query: "column == True"
1 strain passed all filters

$ sort filtered_strains.txt
SEQ_1

It's possible to have only True values.

$ cat >metadata.tsv <<~~
> strain column
> SEQ_1 True
> SEQ_2 True
> SEQ_3 True
> ~~

$ ${AUGUR} filter \
> --metadata metadata.tsv \
> --query "column == True" \
> --output-strains filtered_strains.txt
0 strains were dropped during filtering
3 strains passed all filters

$ sort filtered_strains.txt
SEQ_1
SEQ_2
SEQ_3

0 comments on commit df73174

Please sign in to comment.