-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
29 lines (25 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Your program must compile with 'make'
# You must not change this file.
CC = gcc
FLAGS = -std=c99 -O0 -Wall -Werror -g -pedantic
rgrep:
$(CC) $(FLAGS) rgrep.c -o rgrep
clean:
rm -rf rgrep *.dSYM
check: clean rgrep
test "`echo "a\nb\nc" | ./rgrep 'a'`" = "a"
test "`echo "a\n" | ./rgrep 'a'`" = "a"
test "`echo "a" | ./rgrep '...'`" = ""
test "`echo "abc" | ./rgrep '.b.'`" = "abc"
test "`echo "h\naaaaah" | ./rgrep 'a+h'`" = "aaaaah"
test "`echo "h\naaaaahhhhh" | ./rgrep 'aa+hh+'`" = "aaaaahhhhh"
test "`echo "h\naaaaahhhhh\n" | ./rgrep 'aa+hh+'`" = "aaaaahhhhh"
test "`echo "a" | ./rgrep 'a?a'`" = "a"
test "`echo "woot\nwot\nwat\n" | ./rgrep 'wo?t'`" = "wot"
# test "`echo "CCCCCCC\nC+\nC++" | ./rgrep '.\+\+'`" = "C++"
# test "`echo "GG" | ./rgrep '.+'`" = "GG"
# test "`echo "woooooo_CSE31.jpg" | ./rgrep 'w.+_...31\.jpg'`" = "woooooo_CSE31.jpg"
test "`echo "aab" | ./rgrep 'bb?'`" = "aab"
test "`echo "aaab" | ./rgrep 'a+b'`" = "aaab"
test "`echo "aaab" | ./rgrep 'a+ab'`" = "aaab"
@echo "Passed sanity check."