diff options
| author | Teddy Wing | 2015-06-14 00:52:37 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-06-14 00:52:37 -0400 |
| commit | a6fdd1f6f7a23d03796a04d51220478a50194146 (patch) | |
| tree | 3b2cc4c36c7109f3c50223b0686dbdeb359c6cb4 /test.sh | |
| parent | b40bd57c22669263ea2db88da07c5abac17157cf (diff) | |
| download | irssi-hipchat-stfu-a6fdd1f6f7a23d03796a04d51220478a50194146.tar.bz2 | |
Get tests working to test `prettify_hipchat` sub
* test.sh: Create a temporary file `prettify_hipchat.pl` that contains
only the `prettify_hipchat` subroutine. Then run `test.pl`. Finally
remove the file we created to contain the subroutine.
* Require `prettify_hipchat.pl` from test.pl. This file contains only
the `prettify_hipchat` subroutine, allowing us to require it without
concern.
Diffstat (limited to 'test.sh')
| -rwxr-xr-x[-rw-r--r--] | test.sh | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,15 @@ #!/usr/bin/env sh -pcregrep -M '^sub prettify_hipchat {.*(\n|.)*?}' hipchat-stfu.pl +sub=$(pcregrep -M '^sub prettify_hipchat {.*(\n|.)*?}' hipchat-stfu.pl) + +cat > prettify_hipchat.pl <<EOF +use strict; + +$sub + +1; +EOF + +./test.pl + +rm prettify_hipchat.pl |
