# 
# Copyright © 2024 Thomas von Dein
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 

# simple entry
exec anydb -f test.db set foo bar

# single entry uc()
exec anydb -f test.db set MUCHAS gracias

# entry with tags
exec anydb -f test.db set color grey -t flower,plant

# simple list
exec anydb -f test.db list
stdout foo.*bar

# wide list
exec anydb -f test.db list -m wide
stdout 'plant.*now.*grey'

# list tagged
exec anydb -f test.db list -t flower
! stdout bar

# list with filter
exec anydb -f test.db list b.r -s
stdout bar

# list with -i filter
exec anydb -f test.db list -is mucha 
stdout mucha

# get single entry
exec anydb -f test.db get color
stdout grey

# modify
exec anydb -f test.db set foo blah

# check modified
exec anydb -f test.db get foo
stdout blah

# modify tagged
exec anydb -f test.db set color grey -t butterfly

# check modified tagged
exec anydb -f test.db list -t butterfly
stdout grey

# check modified tagged, make sure
exec anydb -f test.db list -t flower
! stdout grey

# check json output
exec anydb -f test.db list -m json
stdout '^\[\{'

exec anydb -f test.db get color -m json
stdout '^\{'

# delete entry
exec anydb -f test.db del foo

# check deleted
exec anydb -f test.db list
! stdout blah
