From 2aa70b3364e40fc3b8c75c9d2684074957677582 Mon Sep 17 00:00:00 2001 From: PeterCJ Date: Sat, 20 Jun 2020 14:53:29 -0700 Subject: [PATCH] finish #47: prompt(prompt, title, default) works properly and has test to prove it; update rev to 0.004001 --- CHANGES | 7 +++++++ MANIFEST | 1 + lib/Win32/Mechanize/NotepadPlusPlus.pm | 2 +- lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm | 2 +- lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm | 2 +- t/npp-gui.t | 4 ++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 08d67360..863c0a1c 100644 --- a/CHANGES +++ b/CHANGES @@ -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, diff --git a/MANIFEST b/MANIFEST index f5831b47..46958e5f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -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 diff --git a/lib/Win32/Mechanize/NotepadPlusPlus.pm b/lib/Win32/Mechanize/NotepadPlusPlus.pm index e1afb330..931886cd 100644 --- a/lib/Win32/Mechanize/NotepadPlusPlus.pm +++ b/lib/Win32/Mechanize/NotepadPlusPlus.pm @@ -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'; diff --git a/lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm b/lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm index 1df48695..3c340632 100644 --- a/lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm +++ b/lib/Win32/Mechanize/NotepadPlusPlus/Editor.pm @@ -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); diff --git a/lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm b/lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm index 569a3dc2..fb8b4c2c 100644 --- a/lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm +++ b/lib/Win32/Mechanize/NotepadPlusPlus/Notepad.pm @@ -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); diff --git a/t/npp-gui.t b/t/npp-gui.t index c23ce6f6..160e5e41 100644 --- a/t/npp-gui.t +++ b/t/npp-gui.t @@ -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 // ''; + # 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 // ''; + } # moved to npp-menucmd.t: