Debian Codegraph @

ctags/Tmain/readtags-qualifier-regex.d/run.sh

raw
1 #!/bin/sh
2
3 # Copyright: 2020 Masatake YAMATO
4 # License: GPL-2
5
6 READTAGS=$3
7
8 . ../utils.sh
9
10 #V="valgrind --leak-check=full -v"
11 V=
12
13 if ! [ -x "${READTAGS}" ]; then
14 skip "no readtags"
15 fi
16
17 if ! ( "${READTAGS}" -h | grep -q -e -Q ); then
18 skip "no qualifier function in readtags"
19 fi
20
21 echo '# case sensitive'
22 ${V} ${READTAGS} -t output.tags -Q '(and $signature (#/char,.*,char|int,.*,int/ $signature))' -en -l
23
24 echo '# case insensitive: the pattern is lower case'
25 ${V} ${READTAGS} -t output.tags -Q '(and $signature (#/char,.*,char|int,.*,int/i $signature))' -en -l
26
27 echo '# case insensitive: the pattern is upper case'
28 ${V} ${READTAGS} -t output.tags -Q '(and $signature (#/CHAR,.*,CHAR|INT,.*,INT/i $signature))' -en -l
29
30 echo '# case sensitive (string->regexp)'
31 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "char,.*,char|int,.*,int") $signature)) #f) #f)' -en -l
32
33 echo '# case sensitive (string->regexp :case-fold #f)'
34 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "char,.*,char|int,.*,int" :case-fold #f) $signature)) #f) #f)' -en -l
35
36 echo '# case sensitive (string->regexp :case-fold false)'
37 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "char,.*,char|int,.*,int" :case-fold false) $signature)) #f) #f)' -en -l
38
39 echo '# case insensitive: the pattern is lower case (string->regexp :case-fold #t)'
40 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "char,.*,char|int,.*,int" :case-fold #t) $signature)) #f) #f)' -en -l
41
42 echo '# case insensitive: the pattern is upper case (string->regexp :case-fold true)'
43 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "CHAR,.*,CHAR|INT,.*,INT" :case-fold true) $signature)) #f) #f)' -en -l
44
45 echo '# RAISING AN ERROR' 1>&2
46 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature (#/[/ $signature)) #f) #f)' -en -l
47
48 echo '# RAISING AN ERROR (string->regexp)' 1>&2
49 ${V} ${READTAGS} -t output.tags -Q '(or #f #f (or #f (and $signature ((string->regexp "[") $signature)) #f) #f)' -en -l