Hi Andreas,
The reason why you can't set the pattern this way is because pattern is
a "global" option, and adjustOption can only set "local" options (such
as the number of quickcheck tests etc.).
I agree this is not intuitive and I should find a way to improve it.
Here are some ideas to work around for now.
First, you can set it in ghci like this:
> :set args -p mypattern
Second, you can pass options through environment variables. So, for
instance, you could launch ghci like this:
TASTY_PATTERN=mypattern ghci MyTest.hs
You can also set the environment variable programmatically (so you could
write your mainp if you wanted, and if you don't mind its non-local
effects):
> :m +System.Environment
> setEnv "TASTY_PATTERN" "findShortestPrefix"