From 7e95148593d498388787fbc8f0a998cc8389702b Mon Sep 17 00:00:00 2001 From: Pairi Daiza Date: Sat, 4 Jan 2020 20:06:03 +0100 Subject: [PATCH] Add Error UTF-8 Encoding test files with issue # --- ... Detection Single UTF-8 (issue #1848).txt} | 0 ...on Single UTF-8 with tag (issue #1848).txt | 31 +++++++ ...ion UTF-8 np3portableapp (issue #1848).cmd | 91 +++++++++++++++++++ ... np3portableapp with tag (issue #1848).cmd | 91 +++++++++++++++++++ ...encoding_utf-8 with tag (issue #1831).json | 10 ++ ...tection_UTF-8 (no Sign) (issue #1852).txt} | 0 6 files changed, 223 insertions(+) rename test/test_files/encoding/UTF-8/{Error Detection Single UTF-8 (issue #1848).txt => Error Detection Single UTF-8 (issue #1848).txt} (100%) create mode 100644 test/test_files/encoding/UTF-8/Error Detection Single UTF-8 with tag (issue #1848).txt create mode 100644 test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp (issue #1848).cmd create mode 100644 test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp with tag (issue #1848).cmd create mode 100644 test/test_files/encoding/UTF-8/Error Detection encoding_utf-8 with tag (issue #1831).json rename test/test_files/encoding/UTF-8/{Error Detection UTF-8 (no Sign) (issue #1852).txt => Error Detection_UTF-8 (no Sign) (issue #1852).txt} (100%) diff --git a/test/test_files/encoding/UTF-8/Error Detection Single UTF-8 (issue #1848).txt b/test/test_files/encoding/UTF-8/Error Detection Single UTF-8 (issue #1848).txt similarity index 100% rename from test/test_files/encoding/UTF-8/Error Detection Single UTF-8 (issue #1848).txt rename to test/test_files/encoding/UTF-8/Error Detection Single UTF-8 (issue #1848).txt diff --git a/test/test_files/encoding/UTF-8/Error Detection Single UTF-8 with tag (issue #1848).txt b/test/test_files/encoding/UTF-8/Error Detection Single UTF-8 with tag (issue #1848).txt new file mode 100644 index 000000000..6ced40cfc --- /dev/null +++ b/test/test_files/encoding/UTF-8/Error Detection Single UTF-8 with tag (issue #1848).txt @@ -0,0 +1,31 @@ +Apache on Windows: +================== +// encoding: UTF-8 + +* Which distribution? + +apache.org no longer provides Windows binaries. They direct you to other sources. + +Candidates: + - The Apache Haus (apachehaus.com) + - Apache Lounge (apachelounge.com) + +My current favourite is Apache Lounge. Use the distro with the highest Visual C version you can, and that matches the target system architecture. + +Prerequisite: Visual C++ Redistributable + + +* Updating: + +(Also check for the latest Visual C++ Redistributable) + +Précis: + +- Build a new folder at same level as production folder, with "_new" suffix +- Copy as much production data as possible to new folder +- Stop (old) production +- Copy remainder of production data to new folder, moving what can't be copied because of space constraints +- Rename production folder to backup folder (becomes backup) +- Rename new folder to production folder (becomes production) +- Start (new) production and test + diff --git a/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp (issue #1848).cmd b/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp (issue #1848).cmd new file mode 100644 index 000000000..0b4ce1f4f --- /dev/null +++ b/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp (issue #1848).cmd @@ -0,0 +1,91 @@ +@echo off +:: +exit +setlocal enableextensions +:: ==================================================================================================================== +:: Build batch to create a PortableApps.com's (https://portableapps.com/development) +:: +:: Notepad3Portable +:: +:: -------------------------------------------------------------------------------------------------------------------- +:: Based on PortableApps.com's Application_Template +:: (https://downloads.sourceforge.net/portableapps/PortableApps.com_Application_Template_3.4.1.zip) +:: -------------------------------------------------------------------------------------------------------------------- +:: Prerequisites: (portable) intallation of: +:: ----------------------------------------- +:: + PortableApps.com App Compactor (https://portableapps.com/apps/utilities/appcompactor) +:: +:: + PortableApps.com Launcher (https://portableapps.com/apps/development/portableapps.com_launcher) +:: (needed to create the Notepad3Portable.exe Launcher from the sources) +:: +:: + PortableApps.com Installer (https://portableapps.com/apps/development/portableapps.com_installer) +:: +:: ==================================================================================================================== + +::more than 100 lines are suppressed + +:: ==================================================================================================================== +goto :END +:: REPLACE strg(%1) srcfile(%2) replstrg(%3) dstfile(%4) +:REPLACE + if exist "%~4" del /F /Q "%~4" + type NUL > "%~4" + for /f "tokens=1,* delims=¶" %%A in (%~2) do ( + set string=%%A + setlocal EnableDelayedExpansion + set modified=!string:%~1=%~3! + >> "%~4" echo(!modified! + endlocal + ) + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETDATE + for /f "tokens=2 delims==" %%a in (' + wmic OS Get localdatetime /value + ') do set "dt=%%a" + set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" + set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" + ::set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%" + ::set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%" + ::echo datestamp: "%datestamp%" + ::echo timestamp: "%timestamp%" + ::echo fullstamp: "%fullstamp%" + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETFILEVER + set "file=%~1" + if not defined file goto:EOF + if not exist "%file%" goto:EOF + set "FILEVER=" + for /F "tokens=2 delims==" %%a in (' + wmic datafile where name^="%file:\=\\%" Get Version /value + ') do set "FILEVER=%%a" + ::echo %file% = %FILEVER% + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETBUILD + set /p nxbuild=<%NP3_BUILD_VER% + set /a BUILD = %nxbuild% - 1 + set /p DEVNAME=<%NP3_BUILD_NAME% + set DEVNAME=%DEVNAME:"=% + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +rem Resolve path to absolute. +rem Param 1: Name of output variable. +rem Param 2: Path to resolve. +rem Return: Resolved absolute path. +:RESOLVEPATH + set %1=%~dpfn2 + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:: ==================================================================================================================== +:END +endlocal +::pause +::exit +:: ==================================================================================================================== diff --git a/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp with tag (issue #1848).cmd b/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp with tag (issue #1848).cmd new file mode 100644 index 000000000..a51111e21 --- /dev/null +++ b/test/test_files/encoding/UTF-8/Error Detection UTF-8 np3portableapp with tag (issue #1848).cmd @@ -0,0 +1,91 @@ +@echo off +:: encoding: UTF-8 +exit +setlocal enableextensions +:: ==================================================================================================================== +:: Build batch to create a PortableApps.com's (https://portableapps.com/development) +:: +:: Notepad3Portable +:: +:: -------------------------------------------------------------------------------------------------------------------- +:: Based on PortableApps.com's Application_Template +:: (https://downloads.sourceforge.net/portableapps/PortableApps.com_Application_Template_3.4.1.zip) +:: -------------------------------------------------------------------------------------------------------------------- +:: Prerequisites: (portable) intallation of: +:: ----------------------------------------- +:: + PortableApps.com App Compactor (https://portableapps.com/apps/utilities/appcompactor) +:: +:: + PortableApps.com Launcher (https://portableapps.com/apps/development/portableapps.com_launcher) +:: (needed to create the Notepad3Portable.exe Launcher from the sources) +:: +:: + PortableApps.com Installer (https://portableapps.com/apps/development/portableapps.com_installer) +:: +:: ==================================================================================================================== + +::more than 100 lines are suppressed + +:: ==================================================================================================================== +goto :END +:: REPLACE strg(%1) srcfile(%2) replstrg(%3) dstfile(%4) +:REPLACE + if exist "%~4" del /F /Q "%~4" + type NUL > "%~4" + for /f "tokens=1,* delims=¶" %%A in (%~2) do ( + set string=%%A + setlocal EnableDelayedExpansion + set modified=!string:%~1=%~3! + >> "%~4" echo(!modified! + endlocal + ) + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETDATE + for /f "tokens=2 delims==" %%a in (' + wmic OS Get localdatetime /value + ') do set "dt=%%a" + set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" + set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" + ::set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%" + ::set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%" + ::echo datestamp: "%datestamp%" + ::echo timestamp: "%timestamp%" + ::echo fullstamp: "%fullstamp%" + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETFILEVER + set "file=%~1" + if not defined file goto:EOF + if not exist "%file%" goto:EOF + set "FILEVER=" + for /F "tokens=2 delims==" %%a in (' + wmic datafile where name^="%file:\=\\%" Get Version /value + ') do set "FILEVER=%%a" + ::echo %file% = %FILEVER% + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:GETBUILD + set /p nxbuild=<%NP3_BUILD_VER% + set /a BUILD = %nxbuild% - 1 + set /p DEVNAME=<%NP3_BUILD_NAME% + set DEVNAME=%DEVNAME:"=% + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +rem Resolve path to absolute. +rem Param 1: Name of output variable. +rem Param 2: Path to resolve. +rem Return: Resolved absolute path. +:RESOLVEPATH + set %1=%~dpfn2 + goto:EOF +:: -------------------------------------------------------------------------------------------------------------------- + +:: ==================================================================================================================== +:END +endlocal +::pause +::exit +:: ==================================================================================================================== diff --git a/test/test_files/encoding/UTF-8/Error Detection encoding_utf-8 with tag (issue #1831).json b/test/test_files/encoding/UTF-8/Error Detection encoding_utf-8 with tag (issue #1831).json new file mode 100644 index 000000000..e5699d22f --- /dev/null +++ b/test/test_files/encoding/UTF-8/Error Detection encoding_utf-8 with tag (issue #1831).json @@ -0,0 +1,10 @@ +// encoding: UTF-8 +{ + "manifest_version": 2, + "name": "k view", + "version": "0.5", + "description": "テスト。", + "browser_action": { + "default_icon": { "19": "round-done-button.png" } + }, +} \ No newline at end of file diff --git a/test/test_files/encoding/UTF-8/Error Detection UTF-8 (no Sign) (issue #1852).txt b/test/test_files/encoding/UTF-8/Error Detection_UTF-8 (no Sign) (issue #1852).txt similarity index 100% rename from test/test_files/encoding/UTF-8/Error Detection UTF-8 (no Sign) (issue #1852).txt rename to test/test_files/encoding/UTF-8/Error Detection_UTF-8 (no Sign) (issue #1852).txt