mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
Add '-not' flag for excluding tags from filter
Add tests for the excluding tags with -not
This commit is contained in:
parent
bd806efb98
commit
c249c8ded9
3 changed files with 42 additions and 3 deletions
|
@ -50,3 +50,35 @@ Feature: Tagging
|
|||
@foo : 1
|
||||
@bar : 1
|
||||
"""
|
||||
|
||||
Scenario: Excluding a tag should filter it
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl today: @foo came over, we went to a bar"
|
||||
When we run "jrnl I have decided I did not enjoy that @bar"
|
||||
When we run "jrnl --tags -not @bar"
|
||||
Then the output should be
|
||||
"""
|
||||
@foo : 1
|
||||
"""
|
||||
|
||||
Scenario: Excluding a tag should filter an entry, even if an unfiltered tag is in that entry
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl today: I do @not think this will show up @thought"
|
||||
When we run "jrnl today: I think this will show up @thought"
|
||||
When we run "jrnl --tags -not @not"
|
||||
Then the output should be
|
||||
"""
|
||||
@thought : 1
|
||||
"""
|
||||
|
||||
Scenario: Excluding multiple tags should filter them
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl today: I do @not think this will show up @thought"
|
||||
When we run "jrnl today: I think this will show up @thought"
|
||||
When we run "jrnl today: This should @never show up @thought"
|
||||
When we run "jrnl today: What a nice day for filtering @thought"
|
||||
When we run "jrnl --tags -not @not @never"
|
||||
Then the output should be
|
||||
"""
|
||||
@thought : 2
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue