Add more unit tests for function list

Following the commit 7fad2a62d4
This commit is contained in:
Don Ho 2023-01-17 03:32:46 +01:00
parent 7fad2a62d4
commit b280db88dc
10 changed files with 89 additions and 3 deletions

View File

@ -29,6 +29,14 @@ Func logoff() ; Start of the logoff function
Exit ; Quit the program Exit ; Quit the program
EndFunc ; End of the logoff Function 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 Func cancel() ; Start of the cancel function
GUISetState(@SW_HIDE) ; Hide the Window GUISetState(@SW_HIDE) ; Hide the Window
Exit ; Quit the program Exit ; Quit the program

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 // Declares a function with the "C" ABI
extern "C" fn new_i32() -> i32 { 0 } extern "C" fn new_i32() -> i32 { 0 }

View File

@ -70,4 +70,21 @@ PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER) IS
END IF; END IF;
END; 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;
*/
/ /

View File

@ -15,6 +15,16 @@ function extractKeywords(text) {
filter(function(v, i, a) { return a.lastIndexOf(v) === i; }); 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) { function convertBasicMarkup(input, allowHtml) {
var strongRe = /[*]{2}([^*]+)[*]{2}/gm; var strongRe = /[*]{2}([^*]+)[*]{2}/gm;

View File

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