diff options
| author | Peter Pentchev <roam@ringlet.net> | 2024-09-10 23:49:05 +0300 |
|---|---|---|
| committer | Peter Pentchev <roam@ringlet.net> | 2024-09-11 21:32:24 +0300 |
| commit | 7b0cce752eca91696664c2bb0de3c5e0395f3fda (patch) | |
| tree | 9f9c62c53aecdc669cec6ff05d19a478b0895bf7 /challenge-286/ppentchev/tests/03-python-ch-1.t | |
| parent | cbf28e6e924b7cd24d1614a5ad28d801f0e85dea (diff) | |
| download | perlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.tar.gz perlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.tar.bz2 perlweeklychallenge-club-7b0cce752eca91696664c2bb0de3c5e0395f3fda.zip | |
Add Peter Pentchev's Python solutions to 286
Also fix a couple of things in the other files:
- make the TAP test functions accept an arrayref for the command to run
instead of a single string, since we want to run the Python solution using
`python3 -B -u /path/to/the/program`
- fix the use of Test::More::skip() in the Self Spammer test function
- fix a shadowed variable in the Order Game test function
- correct the indentation in the documentation's "Implementation details" section
- make the README file a copy of docs/index.md instead of a wrong copy of
a completely different project's README file
- point blog.txt to the Ringlet copy of this challenge's documentation
Diffstat (limited to 'challenge-286/ppentchev/tests/03-python-ch-1.t')
| -rw-r--r-- | challenge-286/ppentchev/tests/03-python-ch-1.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/challenge-286/ppentchev/tests/03-python-ch-1.t b/challenge-286/ppentchev/tests/03-python-ch-1.t new file mode 100644 index 0000000000..0b3066753f --- /dev/null +++ b/challenge-286/ppentchev/tests/03-python-ch-1.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl +# SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net> +# SPDX-License-Identifier: BSD-2-Clause + +use v5.16; +use strict; +use warnings; + +use Test::More; + +use lib 'tests/lib'; + +use PWCTest::Ch286 qw(find_python3 test_self_spammer); + +my $py3; +BEGIN { + $py3 = find_python3; +} + +if (!defined $py3) { + plan skip_all => 'no Python 3 interpreter found'; + exit 0; +} + +plan tests => 1; + +use constant PROG => 'python/scripts/ch-1.py'; + +subtest self_spammer => sub { + test_self_spammer [$py3, '-B', '-u', '--', PROG], PROG; +}; |
