From f1d6cc7a64bb945aff97e05d9a721298087f9c08 Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Mon, 29 May 2023 13:28:30 +0200 Subject: [PATCH] add test files for NSIS syntax --- tests/syntax-tests/highlighted/NSIS/test.nsi | 61 ++++++++++++++++++++ tests/syntax-tests/source/NSIS/test.nsi | 61 ++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 tests/syntax-tests/highlighted/NSIS/test.nsi create mode 100644 tests/syntax-tests/source/NSIS/test.nsi diff --git a/tests/syntax-tests/highlighted/NSIS/test.nsi b/tests/syntax-tests/highlighted/NSIS/test.nsi new file mode 100644 index 00000000..559896ff --- /dev/null +++ b/tests/syntax-tests/highlighted/NSIS/test.nsi @@ -0,0 +1,61 @@ +/* + * Multi-line + * Comment + */ + +# Single-line comment +; Another-single line comment + +; Includes +!include "LogicLib.nsh" + +; Defines +!define ARCHITECTURE "x64" + +; Compile time command +!echo "Building ${ARCHITECTURE} script" + +; Macro definition +!macro SayHello name + !ifdef name + !echo "Hello, ${name}" + !else + !echo "Hello, world" + !endif +!macroend + +; Macro usage +!insertmacro SayHello "John Doe" + +; Settings +Name "installer_name" +OutFile "installer_name.exe" +RequestExecutionLevel user +CRCCheck on +Unicode true + +!ifdef ${ARCHITECTURE} + InstallDir "$PROGRAMFILES64\installer_name" +!else + InstallDir "$PROGRAMFILES\installer_name" +!endif + +; Pages +Page components +Page instfiles + +; Functions +Function PrintTestStrings + DetailPrint "The install button reads $(^InstallBtn)" + DetailPrint 'Here comes a$\n$\rline-break!' + DetailPrint `Escape the dollar-sign: $$` +FunctionEnd + +; Sections +Section "section_name" section_index + Call PrintTestStrings  + + ; NSIS plugin call + nsExec::ExecToLog "calc.exe" +SectionEnd + diff --git a/tests/syntax-tests/source/NSIS/test.nsi b/tests/syntax-tests/source/NSIS/test.nsi new file mode 100644 index 00000000..1547a1f5 --- /dev/null +++ b/tests/syntax-tests/source/NSIS/test.nsi @@ -0,0 +1,61 @@ +/* + * Multi-line + * Comment + */ + +# Single-line comment +; Another-single line comment + +; Includes +!include "LogicLib.nsh" + +; Defines +!define ARCHITECTURE "x64" + +; Compile time command +!echo "Building ${ARCHITECTURE} script" + +; Macro definition +!macro SayHello name + !ifdef name + !echo "Hello, ${name}" + !else + !echo "Hello, world" + !endif +!macroend + +; Macro usage +!insertmacro SayHello "John Doe" + +; Settings +Name "installer_name" +OutFile "installer_name.exe" +RequestExecutionLevel user +CRCCheck on +Unicode true + +!ifdef ${ARCHITECTURE} + InstallDir "$PROGRAMFILES64\installer_name" +!else + InstallDir "$PROGRAMFILES\installer_name" +!endif + +; Pages +Page components +Page instfiles + +; Functions +Function PrintTestStrings + DetailPrint "The install button reads $(^InstallBtn)" + DetailPrint 'Here comes a$\n$\rline-break!' + DetailPrint `Escape the dollar-sign: $$` +FunctionEnd + +; Sections +Section "section_name" section_index + Call PrintTestStrings + + ; NSIS plugin call + nsExec::ExecToLog "calc.exe" +SectionEnd +