diff --git a/README.md b/README.md index 713b214c..7a92d832 100644 --- a/README.md +++ b/README.md @@ -1342,7 +1342,7 @@ SparForte (sp) Specman e (e) SQL (cql, mysql, psql, SQL, sql, tab, udf, viw) SQL Data (data.sql) -SQL Stored Procedure (spc.sql, spoc.sql, sproc.sql, udf.sql) +SQL Stored Procedure (scp, spc.sql, spoc.sql, sproc.sql, udf.sql) Squirrel (nut) Standard ML (fun, sig, sml) Starlark (bazel, bzl) diff --git a/Unix/t/00_C.t b/Unix/t/00_C.t index c5f6f8fc..89350343 100755 --- a/Unix/t/00_C.t +++ b/Unix/t/00_C.t @@ -1337,6 +1337,11 @@ my @Tests = ( 'ref' => '../tests/outputs/hello.sp.yaml', 'args' => '../tests/inputs/hello.sp', }, + { + 'name' => 'SQL Stored Procedure', + 'ref' => '../tests/outputs/sample.scp.yaml', + 'args' => '../tests/inputs/sample.scp', + }, { 'name' => 'Solidity', 'ref' => '../tests/outputs/solidity.sol.yaml', diff --git a/cloc b/cloc index 91f8f3f4..24b65cd9 100755 --- a/cloc +++ b/cloc @@ -9606,6 +9606,7 @@ sub set_constants { # {{{1 'e' => 'Specman e' , 'sql' => 'SQL' , 'SQL' => 'SQL' , + 'scp' => 'SQL Stored Procedure' , 'sproc.sql' => 'SQL Stored Procedure' , 'spoc.sql' => 'SQL Stored Procedure' , 'spc.sql' => 'SQL Stored Procedure' , diff --git a/tests/inputs/sample.scp b/tests/inputs/sample.scp new file mode 100644 index 00000000..6e6ee662 --- /dev/null +++ b/tests/inputs/sample.scp @@ -0,0 +1,16 @@ +/* +** Script for Server TEST_ASE (Adaptive Server Enterprise/15.7) +** Procedure(s) +** STORED PROCEDURE: dbo.update_customer_status +*/ +create proc dbo.update_customer_status + @customer_id int, + @new_status varchar(20) +as +begin + -- Persist the new status. + update customers + set status = @new_status + where id = @customer_id +end +go diff --git a/tests/outputs/sample.scp.yaml b/tests/outputs/sample.scp.yaml new file mode 100644 index 00000000..dee6ac88 --- /dev/null +++ b/tests/outputs/sample.scp.yaml @@ -0,0 +1,21 @@ +--- +# github.com/AlDanial/cloc +header : + cloc_url : github.com/AlDanial/cloc + cloc_version : 2.11 + elapsed_seconds : 0 + n_files : 1 + n_lines : 16 + files_per_second : 0 + lines_per_second : 0 + report_file : ../tests/outputs/sample.scp.yaml +'SQL Stored Procedure' : + nFiles: 1 + blank: 0 + comment: 6 + code: 10 +SUM: + blank: 0 + comment: 6 + code: 10 + nFiles: 1