forked from bonsai/harakit
32 lines
1.0 KiB
Makefile
32 lines
1.0 KiB
Makefile
|
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||
|
# SPDX-License-Identifier: FSFAP
|
||
|
#
|
||
|
# Copying and distribution of this file, with or without modification, are
|
||
|
# permitted in any medium without royalty provided the copyright notice and this
|
||
|
# notice are preserved. This file is offered as-is, without any warranty.
|
||
|
|
||
|
.PHONY: fop_tests
|
||
|
fop_tests: fop_help fop_functionality fop_delimiter fop_fail
|
||
|
|
||
|
.PHONY: fop_delimiter
|
||
|
fop_delimiter: $(BIN)/fop
|
||
|
test "$$(printf 'test0 test1 test2\n' | $(BIN)/fop -d' ' 2 sed 's/2/4/g')" \
|
||
|
= 'test0 test1 test4'
|
||
|
test "$$(printf 'meowsetwoofsetribbit\n' \
|
||
|
| $(BIN)/fop -d 'set' 1 sed 's/woof/meow/g')" = 'meowsetmeowsetribbit'
|
||
|
|
||
|
.PHONY: fop_fail
|
||
|
fop_fail: $(BIN)/fop
|
||
|
! printf 'test\n' | $(BIN)/fop 1 cat
|
||
|
! printf 'test\n' | $(BIN)/fop 'test' cat
|
||
|
! printf 'test\n' | $(BIN)/fop -d'test' cat
|
||
|
|
||
|
.PHONY: fop_functionality
|
||
|
fop_functionality: $(BIN)/fop
|
||
|
test "$$(printf 'test0␞test1␞test2\n' | $(BIN)/fop 1 sed 's/1/4/g')" \
|
||
|
= 'test0␞test4␞test2'
|
||
|
|
||
|
.PHONY: fop_help
|
||
|
fop_help: $(BIN)/fop
|
||
|
! $(BIN)/fop -h
|