@@ -13,34 +13,43 @@ suite("function helper test", () => {
1313 test ( "validVariableName does not allow variables starting with number" , ( ) => {
1414 assert . equal ( false , validVariableName ( "1as" ) ) ;
1515 } ) ;
16+
1617 test ( "validVariableName returns true with correct variable" , ( ) => {
1718 assert . equal ( true , validVariableName ( "matA" ) ) ;
1819 } ) ;
20+
1921 test ( "validVariableName returns true for variables starting with uppercase" , ( ) => {
2022 assert . equal ( true , validVariableName ( "MatA" ) ) ;
2123 } ) ;
24+
2225 test ( "validVariableName return true for variable starting with _" , ( ) => {
2326 assert . equal ( true , validVariableName ( "_matA" ) ) ;
2427 } ) ;
28+
2529 test ( "parseFuntion return undefined on empty line" , ( ) => {
2630 assert . equal ( undefined , parseFunction ( "" ) ) ;
2731 } ) ;
32+
2833 test ( "parseFuntion return undefined if function keyword is missing" , ( ) => {
2934 assert . equal ( undefined , parseFunction ( "hello" ) ) ;
3035 } ) ;
36+
3137 test ( "parseFuntion return correct function name" , ( ) => {
3238 assert . equal ( "hello" , parseFunction ( "function hello()" ) . name ) ;
3339 } ) ;
3440
3541 test ( "parseFuntion return correct number of args" , ( ) => {
3642 assert . equal ( 2 , parseFunction ( "function hello( a, b)" ) . args . length ) ;
3743 } ) ;
44+
3845 test ( "parseArgs return the correct number of args" , ( ) => {
3946 assert . equal ( 2 , parseArgs ( "a,b" ) . length ) ;
40- } )
47+ } ) ;
48+
4149 test ( "parseArgs handle spaces well" , ( ) => {
4250 assert . equal ( 2 , parseArgs ( " a, b" ) . length ) ;
4351 } ) ;
52+
4453 test ( "parseArgs handle empty args" , ( ) => {
4554 assert . equal ( 0 , parseArgs ( "" ) . length ) ;
4655 } ) ;
0 commit comments