test-mailcap-cache

来自「elinks下lynx是最重要的二个文本浏览器, 在linux下非常实用, el」· 代码 · 共 96 行

TXT
96
字号
#!/bin/sh## Copyright (c) 2005 Jonas Fonseca#test_description='Test mailcap parsing and queryingThis tests the parsing of various mailcap files, if they are"prioritised" correctly, if the test are run correctly andif querying returns the expected mailcap entry.'. "$TEST_LIB"# Set PAGER to something recognisable since it gets appended as# "|copiousoutput_handler" to entries with copiousoutput.export PAGER=copiousoutput_handler################################################################# Parse a simple mailcap filecat > mailcap-basic <<EOF# Mimetype		Handlertext/html;		elinks --force-html %s; needsterminaltext/enriched;		richtext ; copiousoutputtext/*;			view %s; needsterminalapplication/postscript;	ps2ascii %s ; copiousoutput# Convert images to text using the netpbm toolsimage/*;		(anytopnm %s | pnmscale -xysize 200 150 | \                         pnminvert | ppmtopgm | pgmtopbm | \			 pbmtoascii -1x2 ) 2>&1 ; copiousoutputEOFmailcap-cache \	--path "mailcap-basic" \	--format "block,program" \	--get "text/html" \	--get "text/x-csh" \	--get "application/postscript" \	--get "application/foo" \	> outputcat > expected <<EOFtype: text/htmlblock: 1program: elinks --force-html %type: text/x-cshblock: 1program: view %type: application/postscriptblock: 1program: ps2ascii %|copiousoutput_handlertype: application/fooEOFtest_expect_success \	'Parse simple mailcap file.' \	'cmp output expected' \################################################################# Parse a two simple mailcap files; first one with teststouch DISPLAYcat > mailcap-simple-with-test <<EOFapplication/postscript;	gv %s ; test=test -e "DISPLAY" ;image/*;		xzgv %s ; test=test -e "DISPLAY";EOFmailcap-cache \	--path "mailcap-simple-with-test:mailcap-simple" \	--format "block,program" \	--get "image/jpeg" \	--get "application/postscript" \	> outputcat > expected <<EOFtype: image/jpegblock: 0program: xzgv %type: application/postscriptblock: 0program: gv %EOFtest_expect_success \	'Parse two simple mailcap files; first one with tests.' \	'cmp output expected' \test_done

⌨️ 快捷键说明

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