diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..feaa3bb --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,48 @@ +--- +version: 1.0.{build} + +image: + - Visual Studio 2015 + - Visual Studio 2017 + - Visual Studio 2019 + - ubuntu1804 + - Ubuntu + +environment: + PERL5LIB: /home/appveyor/perl5/lib/perl5 + AUTOMATED_TESTING: 1 + # TEST_VERBOSE: 1 + DEBIAN_FRONTEND: noninteractive + PERL_MM_USE_DEFAULT: 1 + NO_NETWORK_TESTING: 1 + +platform: x64 + +branches: + only: + - master + +skip_tags: true + +install: + - cmd: if not exist "C:\strawberry" cinst StrawberryPerl --allow-empty-checksums + - cmd: path C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% + # - cmd: cd C:\projects\%APPVEYOR_PROJECT_NAME% + # Currently fails on http://apt.postgresql.org/pub/repos/apt bionic-pgdg Release + - sh: sudo apt update -q -y + - sh: sudo DEBIAN_FRONTEND=noninteractive apt-get install -q -y --force-yes build-essential git libssl-dev perl + - sh: export PATH=/home/appveyor/perl5/bin:$PATH + - perl -V + - cmd: mkdir %APPVEYOR_BUILD_FOLDER%\tmp + - cmd: set TMPDIR=%APPVEYOR_BUILD_FOLDER%\tmp + - cpan App::cpanminus + - cmd: cpanm -q --showdeps --with-develop --with-suggests . | findstr /v "^perl\>" | cpanm -qin --skip-satisfied + - cpanm -qin --skip-satisfied --installdeps . + - cmd: 'echo End install at: & time /t' + +build_script: + - perl Makefile.PL + +test_script: + - cmd: gmake test + - sh: make test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..33a6308 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,63 @@ +--- +# See https://github.com/actions/virtual-environments +# https://github.com/marketplace/actions/setup-perl-environment + +name: Test Code +on: + push: + branches: + - '*' + tags-ignore: + - '*' + pull_request: + schedule: + - cron: '22 0 7 * *' +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + perl: ['5.40', '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.22'] + name: Perl ${{ matrix.perl }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Setup Perl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: ${{ matrix.perl }} + - run: perl -V + - name: Install Dependencies + env: + AUTOMATED_TESTING: 1 + run: | + cpanm -iqn ExtUtils::MakeMaker Test::Most + cpanm -iqn --skip-satisfied --installdeps --notest . + - name: Make Module + env: + AUTHOR_TESTING: 1 + AUTOMATED_TESTING: 1 + NO_NETWORK_TESTING: 1 + NONINTERACTIVE_TESTING: 1 + run: | + # find . -name build.log | xargs cat + perl Makefile.PL + make + - name: Run Tests + env: + AUTHOR_TESTING: 1 + AUTOMATED_TESTING: 1 + NO_NETWORK_TESTING: 1 + NONINTERACTIVE_TESTING: 1 + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: prove -l -b t + # run: | + # cover -test + # cover -report codecov + # curl -Os https://uploader.codecov.io/latest/macos/codecov + # chmod +x codecov + # ./codecov -t ${{ secrets.CODECOV_TOKEN }} diff --git a/MANIFEST b/MANIFEST index 7b275d4..7df9957 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,3 +1,4 @@ +Changes examples/improver lib/Grammar/Improver.pm LICENSE @@ -5,5 +6,6 @@ Makefile.PL MANIFEST This list of files README.md t/30-basics.t +t/comment-spelling.t t/eof.t t/eol.t diff --git a/lib/Grammar/Improver.pm b/lib/Grammar/Improver.pm index 20d4520..10a476b 100644 --- a/lib/Grammar/Improver.pm +++ b/lib/Grammar/Improver.pm @@ -35,10 +35,6 @@ our $VERSION = '0.01'; The C module interfaces with the LanguageTool API to analyze and improve grammar in text input. -=head1 AUTHOR - -Nigel Horne - =head1 METHODS =head2 new @@ -95,13 +91,13 @@ sub improve_grammar { my $response = $ua->post( $self->{api_url}, Content_Type => 'application/x-www-form-urlencoded', - Content => $payload, + Content => $payload, ); # Check for errors if ($response->is_success) { my $response_content = $response->decoded_content; - my $response_data = decode_json($response_content); + my $response_data = decode_json($response_content); # ::diag(Data::Dumper->new([$response_data])->Dump()); @@ -122,6 +118,12 @@ sub improve_grammar { } } +=head1 AUTHOR + +Nigel Horne + +=cut + 1; __END__ diff --git a/t/comment-spelling.t b/t/comment-spelling.t new file mode 100644 index 0000000..abafa6b --- /dev/null +++ b/t/comment-spelling.t @@ -0,0 +1,15 @@ +#!usr/bin/env perl + +use 5.006; +use strict; +use warnings; + +use Test::DescribeMe qw(author); +use Test::Most; +use Test::Needs { 'Test::Spelling::Comment' => '0.002' }; + +Test::Spelling::Comment->import(); +Test::Spelling::Comment->new()->add_stopwords()->all_files_ok(); + +__DATA__ +LanguageTool