# BEGIN comment here
#
# RUN
# ack command line(s)
# They should NOT be shell-escaped.  Args are split on whitespace before
# being passed in to ack.
#
# YESLINES
# Lines that should match with underlines shown
#                              ^^^^^^^^^^
# YES
# Lines that should match, but without the underlines.
#
# NO
# Lines that should not match.
#
# END
#
# Blank lines are always ignored.



BEGIN Straight -w

RUN
ack -w foo

YES
foo
foo bar

NO
foobar
foot
underfoot

YESLINES
foo-foo football
^^^ ^^^

foo
^^^

End of the line foo
                ^^^

I pity da foo'.
          ^^^

END


BEGIN optional character
RUN
ack foot?

YES
foo
foot
Trampled underfoot
foobarf
foo-bar
foo-bart
football

YESLINES
Our ten-foot foo-bird is foobar.
        ^^^^ ^^^         ^^^

END


BEGIN -w and optional character
RUN
ack -w foot?
ack -w (foot?)
ack -w (?:foot?)

NO
Trampled underfoot
football
foolish

YES
foo
foot
foo-bar
foot-bar

YESLINES
foo
^^^

By the foot
       ^^^^

I pity da foo'.
          ^^^

Our ten-foot foo-bird is foobar.
        ^^^^ ^^^
END


BEGIN -w and optional group
RUN
ack -w foo(bar)?

YES
foo
foobar
foo-bar
foo-bart

NO
Trampled underfoot
foobarf

YESLINES
foobar
^^^^^^

x foobar x
  ^^^^^^

I pity da foo'.
          ^^^

Now everything's all foobar.
                     ^^^^^^

END


BEGIN -w and alternation
RUN
ack -w foo|bar
ack -w (foo|bar)

YES
foo
bar

NO
schmfoo
schmofool
barfly
fubar
barometric
subarometric

YESLINES
Little bunny foo-foo's ten-foot bar is foobar.
             ^^^ ^^^            ^^^

END


BEGIN -w and a function definition
RUN
ack -w (set|get)_user_(name|perm)
ack -w ((set|get)_user_(name|perm))
ack -w (?:(?:set|get)_user_(?:name|perm))
ack -w (?:(set|get)_user_(name|perm))
ack -w ((?:set|get)_user_(?:name|perm))

YES
set_user_name
get_user_perm

NO
reset_user_name
get_user_permission

YESLINES
my $foo = set_user_name( $bar ) + set_user_perm( $foo );
          ^^^^^^^^^^^^^           ^^^^^^^^^^^^^
END


BEGIN Single-letter words
RUN
ack -w \w

YES
A
b
c
!E!

NO
dd
xxx

YESLINES
A man, a plan, a canal: Panama
^      ^       ^
END

# vi:set ft=barfly:
