Skip to content

Commit

Permalink
finish #47: prompt(prompt, title, default) works properly and has tes…
Browse files Browse the repository at this point in the history
…t to prove it; update rev to 0.004001
  • Loading branch information
pryrt committed Jun 20, 2020
1 parent 0e932fd commit 2aa70b3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Revision history for Perl distribution Win32-Mechanize-NotepadPlusPlus

v0.004001 2020-Jun-20
- fix bug in notepad->prompt(), which only used two of the three
arguments, in wrong order (#47); test suite verifies default
values for title and default when they aren't used
- added new examples/pasteSpecial.pl to show how to paste a
clipboard entry other than CF_TEXT into Notepad++

v0.004 2020-Jun-04
- fix bug in propertyNames() which deleted final char (#45)
- implemented helper methods: forEachLine, deleteLine, replaceWholeLine,
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ examples/forum15100-round-numbers.pl
examples/forum19486-list-lexer-propertyNames.pl
examples/genRandomText.pl
examples/npp_selection_filenames_md5.pl
examples/pasteSpecial.pl
examples/readme.txt
lib/Win32/Mechanize/NotepadPlusPlus.pm
lib/Win32/Mechanize/NotepadPlusPlus/__hwnd.pm
Expand Down
2 changes: 1 addition & 1 deletion lib/Win32/Mechanize/NotepadPlusPlus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use strict;
use Exporter 'import';
use Carp;

our $VERSION = '0.004'; # rrr.mmmsss : rrr is major revision; mmm is minor revision; sss is sub-revision (new feature path or bugfix); optionally use _sss instead, for alpha sub-releases
our $VERSION = '0.004001'; # rrr.mmmsss : rrr is major revision; mmm is minor revision; sss is sub-revision (new feature path or bugfix); optionally use _sss instead, for alpha sub-releases

use Win32::Mechanize::NotepadPlusPlus::Notepad ':vars';
use Win32::Mechanize::NotepadPlusPlus::Editor ':vars';
Expand Down
2 changes: 1 addition & 1 deletion lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Win32::Mechanize::NotepadPlusPlus::Editor::Messages; # exports %SCIMSG, whi
use utf8; # there are UTF8 arrows throughout the source code (in POD and strings)
use Config;

our $VERSION = '0.004'; # auto-populated from W::M::NPP
our $VERSION = '0.004001'; # auto-populated from W::M::NPP

our @EXPORT_VARS = (@Win32::Mechanize::NotepadPlusPlus::Editor::Messages::EXPORT);
our @EXPORT_OK = (@EXPORT_VARS);
Expand Down
2 changes: 1 addition & 1 deletion lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BEGIN {
Win32::API::->Import("psapi","BOOL EnumProcessModules(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded)") or die "EnumProcessModules: $^E"; # uncoverable branch true
}

our $VERSION = '0.004'; # auto-populated from W::M::NPP
our $VERSION = '0.004001'; # auto-populated from W::M::NPP

our @EXPORT_VARS = (@Win32::Mechanize::NotepadPlusPlus::Notepad::Messages::EXPORT);
our @EXPORT_OK = (@EXPORT_VARS);
Expand Down
4 changes: 4 additions & 0 deletions t/npp-gui.t
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ local $TODO = undef;
runCodeAndClickPopup( sub { $ret = notepad()->prompt('prompt', 'title', 'default'); }, qr/^\Qtitle\E$/, 1 );
is $ret, undef, 'prompt(): cancel: retval is undef'; note sprintf qq(\t=> "%s"\n), $ret // '<undef>';

# prompt: new test case to make sure that without title and default, it will use "PerlScript notepad->prompt()" and ""
runCodeAndClickPopup( sub { $ret = notepad()->prompt('prompt'); }, qr/^\QPerlScript notepad->prompt()\E$/, 0 );
is $ret, '', 'prompt("prompt",undef,undef): search for title="PerlScript notepad->prompt()" -> retval = ""'; note sprintf qq(\t=> "%s"\n), $ret // '<undef>';

}

# moved to npp-menucmd.t:
Expand Down

0 comments on commit 2aa70b3

Please sign in to comment.