Browse Source

Add more unit tests for function list

Following the commit 7fad2a62d4
pull/12813/head
Don Ho 2 years ago
parent
commit
b280db88dc
  1. 8
      PowerEditor/Test/FunctionList/autoit/unitTest
  2. 7
      PowerEditor/Test/FunctionList/c/unitTest
  3. 12
      PowerEditor/Test/FunctionList/cpp/unitTest
  4. 5
      PowerEditor/Test/FunctionList/javascript/unitTest
  5. 11
      PowerEditor/Test/FunctionList/php/unitTest
  6. 7
      PowerEditor/Test/FunctionList/powershell/unitTest
  7. 8
      PowerEditor/Test/FunctionList/rust/unitTest
  8. 21
      PowerEditor/Test/FunctionList/sql/unitTest
  9. 10
      PowerEditor/Test/FunctionList/typescript/unitTest
  10. 3
      PowerEditor/Test/FunctionList/xml/unitTest

8
PowerEditor/Test/FunctionList/autoit/unitTest

@ -29,6 +29,14 @@ Func logoff() ; Start of the logoff function
Exit ; Quit the program
EndFunc ; End of the logoff Function
#CS
Func logoff()
GUISetState(@SW_HIDE)
Run("u:\logoff.bat")
Exit
EndFunc
#CE
Func cancel() ; Start of the cancel function
GUISetState(@SW_HIDE) ; Hide the Window
Exit ; Quit the program

7
PowerEditor/Test/FunctionList/c/unitTest

@ -124,6 +124,13 @@ static void test()
assert(fabsf(test_quat.q3 - quat.q3) < .01);
}
/*
void commented_func()
{
return;
}
*/
int main()
{
test();

12
PowerEditor/Test/FunctionList/cpp/unitTest

@ -516,6 +516,18 @@ int decStrVal(const TCHAR *str)
return strVal(str, 10);
}
/*
int commentedFunc1()
{
return 1;
}
*/
/*int commentedFunc2()
{
return 2;
}*/
int hexStrVal(const TCHAR *str)
{
return strVal(str, 16);

5
PowerEditor/Test/FunctionList/javascript/unitTest

@ -15,6 +15,11 @@ function extractKeywords(text) {
filter(function(v, i, a) { return a.lastIndexOf(v) === i; });
}
/*
function commentedFunc() {
return 0;
}
*/
function convertBasicMarkup(input, allowHtml) {
var strongRe = /[*]{2}([^*]+)[*]{2}/gm;

11
PowerEditor/Test/FunctionList/php/unitTest

@ -27,15 +27,24 @@ abstract class PageGrille extends PageMotsBleus{
return str_replace ( "\\" , "" , $pStr);
}
function GetJavascriptMajax() {
function GetJavascriptMajax() { /* a block comment */
return "ABC";
}
/*
function commentedFunc1() {
return "commented 1";
}
*/
}
function stringContainAsterisk_test1(){
$target = '/path/to/files/*';
}
/*function commentedFunc2(){
return "commented 2";
}*/
function stringContainAsterisk_test2(){
$target = '/path/to/files/*.jpg';
}

7
PowerEditor/Test/FunctionList/powershell/unitTest

@ -14,6 +14,13 @@ function Clear-Host
$host.PrivateData.ClearHost()
}
<#
function Commented-Func
{
return $s
}
#>
<#
.SYNOPSIS
Simple path completion function for PowerConsole.

8
PowerEditor/Test/FunctionList/rust/unitTest

@ -56,6 +56,14 @@ unsafe fn unsafe_example(n: u32) {
}
}
/*
unsafe fn commented_func(n: u32) {
for n in 1..n + 1 {
fizzbuzz(n);
}
}
*/
// Declares a function with the "C" ABI
extern "C" fn new_i32() -> i32 { 0 }

21
PowerEditor/Test/FunctionList/sql/unitTest

@ -5,7 +5,7 @@ FUNCTION hire
(last_name VARCHAR2, job_id VARCHAR2,
manager_id NUMBER, salary NUMBER,
commission_pct NUMBER, department_id NUMBER)
RETURN NUMBER IS new_empno NUMBER;
RETURN NUMBER IS new_empno NUMBER;
BEGIN
SELECT employees_seq.NEXTVAL
INTO new_empno
@ -69,5 +69,22 @@ PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER) IS
SET commission_pct = commission_pct + comm_incr;
END IF;
END;
END emp_mgmt;
END emp_mgmt;
/*
PROCEDURE commented_func(employee_id NUMBER, comm_incr NUMBER) IS
curr_comm NUMBER;
BEGIN
SELECT commission_pct
INTO curr_comm
FROM employees
WHERE employees.employee_id = increase_comm.employee_id;
IF curr_comm IS NULL
THEN RAISE no_comm;
ELSE
UPDATE employees
SET commission_pct = commission_pct + comm_incr;
END IF;
END;
END emp_mgmt;
*/
/

10
PowerEditor/Test/FunctionList/typescript/unitTest

@ -15,6 +15,16 @@ function extractKeywords(text) {
filter(function(v, i, a) { return a.lastIndexOf(v) === i; });
}
/*
function commentedFunc(text) {
if (!text) return [];
return text.
split(/\s+/).
filter(function(v) { return v.length > 2; }).
filter(function(v, i, a) { return a.lastIndexOf(v) === i; });
}
*/
function convertBasicMarkup(input, allowHtml) {
var strongRe = /[*]{2}([^*]+)[*]{2}/gm;

3
PowerEditor/Test/FunctionList/xml/unitTest

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<GUIConfigs>
<!--
<GUIConfig name="comment">comment</GUIConfig>
-->
<GUIConfig name="ToolBar" visible="yes">standard</GUIConfig>
<GUIConfig name="StatusBar">show</GUIConfig>
<GUIConfig name="TabBar" dragAndDrop="yes" drawTopBar="yes" drawInactiveTab="yes" reduce="yes" closeButton="yes" doubleClick2Close="no" vertical="no" multiLine="no" hide="no" quitOnEmpty="no" />

Loading…
Cancel
Save