#!/bin/sh

cat <<EOF > co-in.$$
【萌え】,<萌>⿱艹<明>⿰日月,え
｟[もえ] (n)
  (1) sprouting/budding/
  (2) (m-sl) (also written 萌ゑ) crush (anime, manga term)/fascination/infatuation
｠
<萌>⿱艹<明>[lr]日月
【萌】[tb]艹<明>⿰<日>⿻口(+1)月
()\\\\)
(()
.á💩􏿽.;
(anything)
(\\a\\b\\e\\f\\t\\n\\r\\cX\\x1E)
<\\x00>;
EOF

./idsgrep '(anything)' co-in.$$ > co-out.$$
echo === >> co-out.$$

./idsgrep -c raw '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c rawnc '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c rawnc '(anything)' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c cooked '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c ascii '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c indent '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c 220000803250 '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep -c 22000083 '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

./idsgrep --color=always -c 000000013700 '?' co-in.$$ >> co-out.$$
echo === >> co-out.$$

perl -e 'print "(".(chr(0)x500).")\n"' | ./idsgrep -c cooked '?' >> co-out.$$
echo === >> co-out.$$

if perl -pe 's/_/\x00/g;s/NWL//g;' <<EOF | diff -c -a co-out.$$ -
【萌え】,<萌>⿱艹<明>⿰日月,え
｟[もえ] (n)
  (1) sprouting/budding/
  (2) (m-sl) (also written 萌ゑ) crush (anime, manga term)/fascination/infatuation
｠
<萌>⿱艹<明>[lr]日月
【萌】[tb]艹<明>⿰<日>⿻口(+1)月
()\\\\)
(()
.á💩􏿽.;
(anything)
(\\a\\b\\e\\f\\t\\n\\r\\cX\\x1E)
<\\x00>;
===
【萌え】,<萌>⿱艹<明>⿰日月,え
｟[もえ] (n)
  (1) sprouting/budding/
  (2) (m-sl) (also written 萌ゑ) crush (anime, manga term)/fascination/infatuation
｠
<萌>⿱艹<明>[lr]日月
【萌】[tb]艹<明>⿰<日>⿻口(+1)月
()\\\\)
(()
.á💩􏿽.;
(anything)
(\\a\\b\\e\\f\\t\\n\\r\\cX\\x1E)
<\\x00>;
===
【萌え】,<萌>⿱艹<明>⿰日月,え
｟[もえ] (n)
  (1) sprouting/budding/
  (2) (m-sl) (also written 萌ゑ) crush (anime, manga term)/fascination/infatuation
｠
<萌>⿱艹<明>[lr]日月
【萌】[tb]艹<明>⿰<日>⿻口(+1)月
()\\\\)
(()
.á💩􏿽.;
(anything)
(\\a\\b\\e\\f\\t\\n\\r\\cX\\x1E)
<\\x00>;
===
(anything)
===
【萌え】,<萌>⿱艹<明>⿰日月,え([もえ] (n\\)
  (1\\) sprouting/budding/
  (2\\) (m-sl\\) (also written 萌ゑ\\) crush (anime, manga term\\)/fascination/infatuation
)
【萌】⿱艹<明>⿰日月
【萌】⿱艹<明>⿰<日>⿻口(+1)月
()\\\\)
(()
.á\\XE001\\x{1F4A9}\\x{10FFFD}.;
?
(	

)
【_】;
===
<\\X840C\\X3048>,<\\X840C>[tb]\\X8279<\\X660E>[lr]\\X65E5\\X6708,\\X3048
   ([\\X3082\\X3048] (n\\)\\n  (1\\) sprouting/budding/\\n  (2\\) (m-sl\\) (also written \\X840C\\X3091\\) crush (anime, manga term\\)/fascination/infatuation\\n)
<\\X840C>[tb]\\X8279<\\X660E>[lr]\\X65E5\\X6708
<\\X840C>[tb]\\X8279<\\X660E>[lr]<\\X65E5>[overlap]\\X53E3(+1)\\X6708
()\\\\)
(()
.\\xE1\\XE001\\x{1F4A9}\\x{10FFFD}.;
(anything)
(\\a\\b\\e\\f\\t\\n\\r\\cX\\x1E)
<\\x00>;
===
【萌え】,
  <萌>⿱
    艹
    <明>⿰
      日
      月
  ,
    え
    ([もえ] (n\\)
  (1\\) sprouting/budding/
  (2\\) (m-sl\\) (also written 萌ゑ\\) crush (anime, manga term\\)/fascination/infatuation
)

【萌】⿱
  艹
  <明>⿰
    日
    月

【萌】⿱
  艹
  <明>⿰
    <日>⿻
      口
      (+1)
    月

()\\\\)

(()

.á\\XE001\\x{1F4A9}\\x{10FFFD}.
  ;

?

(	

)

【_】;

===
〖萌え〗,
	〖萌〗⿱
		艹
		〖明〗⿰
			日
			月
	,
		え
		([もえ] (n\\)
  (1\\) sprouting/budding/
  (2\\) (m-sl\\) (also written 萌ゑ\\) crush (anime, manga term\\)/fascination/infatuation
)_〖萌〗⿱
	艹
	〖明〗⿰
		日
		月_〖萌〗⿱
	艹
	〖明〗⿰
		〖日〗⿻
			口
			(+1)
		月_()\\\\)_(()_.á\\XE001\\x{1F4A9}\\x{10FFFD}.
	;_?_(	

)_〖_〗;_===
〖萌え〗,
	〖萌〗⿱
		艹
		〖明〗⿰
			日
			月
	,
		え
		([もえ] (n\)
  (1\) sprouting/budding/
  (2\) (m-sl\) (also written 萌ゑ\) crush (anime, manga term\)/fascination/infatuation
)〖萌〗⿱
	艹
	〖明〗⿰
		日
		月〖萌〗⿱
	艹
	〖明〗⿰
		〖日〗⿻
			口
			(+1)
		月()\\\\)(().á\XE001\x{1F4A9}\x{10FFFD}.
	;?(	

)〖_〗;===
[0;37m<\萌\え>[1;36m,[0;37m<\萌>[1;36m⿱[1;37m\艹[0;37m<\明>[1;36m⿰[1;37m\日[1;37m\月[1;36m,[1;37m\え[0;32m(\[\も\え\]\ \(n\)\NWL
\ \ \(\1\)\ sprouting\/budding\/\NWL
\ \ \(\2\)\ \(m\-sl\)\ \(also\ written\ \萌\ゑ\)\ crush\ \(anime\,\ manga\ term\)\/fascination\/infatuation\NWL
)
[0;37m<\萌>[1;36m⿱[1;37m\艹[0;37m<\明>[1;36m⿰[1;37m\日[1;37m\月
[0;37m<\萌>[1;36m⿱[1;37m\艹[0;37m<\明>[1;36m⿰[0;37m<\日>[1;36m⿻[1;37m\口[0;32m(\+\1)[1;37m\月
[0;32m(\)\\\\)
[0;32m(\()
[0;35m.\á\\💩\􏿽.[1;32m;
[1;32m?
[0;32m(\\\\\	\NWL
\
\\)
[0;37m<\_>[1;32m;
===
(____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________)
===
EOF
then
  rm -f co-in.$$
  rm -f co-out.$$
  exit 0
else
  rm -f co-in.$$
  rm -f co-out.$$
  exit 1
fi
