#!/bin/sh
#
# line input

: ${srcdir=.}

failures=0

# first match should be "a:a b"
match=`echo "a b" | ${BOOL} 'a AND b OR c' | sed -n '1p'`
if test "$match" != "a:a b" ; then
  echo "Test #1 failed"
  failures=1
fi

# second match should be "b:a b"
match=`echo "a b" | ${BOOL} 'a AND b OR c' | sed -n '2p'`
if test "$match" != "b:a b" ; then
  echo "Test #2 failed"
  failures=1
fi

# should not find a third match
match=`echo "a b" | ${BOOL} 'a AND b OR c' | sed -n '3p'`
if test -n "$match" ; then
  echo "Test #3 failed"
  failures=1
fi

exit $failures
