⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 runtests

📁 These files contain a port, to Python of the inexact string matching functionality of agrep.
💻
字号:
#!/usr/bin/env ksh# Performs tests on agrepy via the python program testagrepy.py# args are: <indel count [-e]> <pattern string> <infile name> <outfile name>function run_a_test {  testagrepy.py -$1 -s $2 $3 > out  if cmp out $4  then    echo "Test: $1 $2 $3 ok"  else    echo "Test: $1 $2 $3 fails"  fi}function run_an_errs_test {  testagrepy.py -$1 -s $2 $3 > out 2> errs  if cmp out $4  then    if cmp errs $5    then	echo "Test: $1 $2 $3 ok"    else        echo "Test: $1 $2 $3 fails (output ok; errors incorrect)"    fi else    echo "Test: $1 $2 $3 fails" fi}SHORT_LONG=$(awk '$2=="SHORT_LONG" {print $3}' agrepy.h)sed -e "/SHORT_LONG/s/$SHORT_LONG/100/" agrepy.h > xxxmv xxx agrepy.hprint "\nTesting sagrepy (short-string matching)\n"make cleanmakeprintI=1for S in Actinomycetaceae caggcctaacacatgcaagtc caggcctaacacatgcaagtcdo  run_a_test 3 $S xxxy$I out$I  I=$(($I + 1))donesed -e "/SHORT_LONG/s/100/1/" agrepy.h > xxxmv xxx agrepy.hprint "\nTesting lagrepy (long-string matching)\n"make cleanmakeechoI=1for S in Actinomycetaceae caggcctaacacatgcaagtc caggcctaacacatgcaagtcdo  run_a_test 3 $S xxxy$I out$I  I=$(($I + 1))doneprint "\nTesting extension of matching to cover entire pattern\n"run_a_test "3 -e" Actinomycetaceae xxxy1 out1erun_a_test "3 -e" caggcctaacacatgcaagtc xxxy3 out3eprint "\nVery long text string"run_a_test 1 PQIAMFCGRLNMHMNVQNGKW long_string out.longprint "\nSome error conditions"run_an_errs_test 0 Actinomycetaceae xxxy1 out.errs1 errs.errs1run_an_errs_test 1 $(<long_pattern) long_string out.errs2  errs.errs2# Tidy up!sed -e "/SHORT_LONG/s/1/$SHORT_LONG/" agrepy.h > xxxmv xxx agrepy.hrm out

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -