#!/bin/sh

# $Id: grep,v 1.2 1998/09/16 23:56:17 phil Exp $
# Copyright (c) 1998  Philip Hands <phil@hands.com>
# This program is distributed under the terms of the GPL.

# Example test script, for use with the debian-test package, for
# testing that grep is vaugly functional.

# check that grep is installed
test -e /bin/grep || exit 0

. ${DEBIANTEST_LIB}/functions.sh

test_simple() {
  test "feeble" = `echo -e "this\nis\na\nfeeble\ntest" | grep 'fee'`
}

test_bo() {
  test "10:feeble" = `echo -e "this\nis\na\nfeeble\ntest" | grep -b 'fee'`
}

runtest "Simple substring"                     test_simple
runtest "Simple substring, with byte offset"   test_bo 
