@ -1078,6 +1080,7 @@ function IntegrationTest44() {
functionIntegrationTest45() {
functionIntegrationTest45() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
settings.Indentation=" ";
settings.Indentation=" ";
letinput='REPORT\n"A_ARITH_MOD_tester.main Tester is now ready. A total OF " &\nINTEGER\'image(totalTests) & " tests have been detected.";';
letinput='REPORT\n"A_ARITH_MOD_tester.main Tester is now ready. A total OF " &\nINTEGER\'image(totalTests) & " tests have been detected.";';
letexpected='report\r\n "A_ARITH_MOD_tester.main Tester is now ready. A total OF " &\r\n integer\'image(totalTests) & " tests have been detected.";';
letexpected='report\r\n "A_ARITH_MOD_tester.main Tester is now ready. A total OF " &\r\n integer\'image(totalTests) & " tests have been detected.";';
@ -1088,6 +1091,7 @@ function IntegrationTest45() {
functionIntegrationTest46() {
functionIntegrationTest46() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='impure function delay(\r\n l : integer\r\n) return time is\r\n variable r : real;\r\nbegin\r\n result := 2ps;\r\n return result;\r\nend function;';
letinput='impure function delay(\r\n l : integer\r\n) return time is\r\n variable r : real;\r\nbegin\r\n result := 2ps;\r\n return result;\r\nend function;';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("impure function indent",input,actual);
assertAndCountTest("impure function indent",input,actual);
@ -1096,6 +1100,7 @@ function IntegrationTest46() {
functionIntegrationTest47() {
functionIntegrationTest47() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
settings.Indentation=" ";
settings.Indentation=" ";
letinput='result := 1\r\n 1\r\n + 1; -- hello';
letinput='result := 1\r\n 1\r\n + 1; -- hello';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
@ -1105,6 +1110,7 @@ function IntegrationTest47() {
functionIntegrationTest48() {
functionIntegrationTest48() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='function delay(\r\n l : integer\r\n) return time is\r\n variable r : real;\r\nbegin\r\n result := 2ps;\r\n return result;\r\nend function;';
letinput='function delay(\r\n l : integer\r\n) return time is\r\n variable r : real;\r\nbegin\r\n result := 2ps;\r\n return result;\r\nend function;';
@ -1139,6 +1145,7 @@ function IntegrationTest51() {
functionIntegrationTest52() {
functionIntegrationTest52() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nimpure function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nfunction a(\r\n b : integer\r\n c : integer\r\n) return integer;';
letinput='function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nimpure function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nfunction a(\r\n b : integer\r\n c : integer\r\n) return integer;';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("function without sequential statements",input,actual);
assertAndCountTest("function without sequential statements",input,actual);
@ -1147,6 +1154,7 @@ function IntegrationTest52() {
functionIntegrationTest53() {
functionIntegrationTest53() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nimpure function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nfunction a(\r\n b : integer\r\n c : integer\r\n) return integer;';
letinput='function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nimpure function a(\r\n b : integer\r\n c : integer\r\n) return integer;\r\n\r\nfunction a(\r\n b : integer\r\n c : integer\r\n) return integer;';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("function without sequential statements, without new line",input,actual);
assertAndCountTest("function without sequential statements, without new line",input,actual);
@ -1185,6 +1193,7 @@ function IntegrationTest57() {
functionIntegrationTest58() {
functionIntegrationTest58() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='package body a is\r\n procedure b(\r\n signal a : in boolean;\r\n b : boolean\r\n ) is\r\n begin\r\n a = 1\r\n end procedure b;\r\nend a;';
letinput='package body a is\r\n procedure b(\r\n signal a : in boolean;\r\n b : boolean\r\n ) is\r\n begin\r\n a = 1\r\n end procedure b;\r\nend a;';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("package body",input,actual);
assertAndCountTest("package body",input,actual);
@ -1193,6 +1202,7 @@ function IntegrationTest58() {
functionIntegrationTest59() {
functionIntegrationTest59() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.KeywordCase="lowercase";
settings.KeywordCase="lowercase";
settings.TypeNameCase="lowercase";
letinput='package body a is\r\n procedure b(\r\n signal a : in boolean;\r\n b : boolean) is\r\n begin\r\n a = 1\r\n end procedure b;\r\nend a;';
letinput='package body a is\r\n procedure b(\r\n signal a : in boolean;\r\n b : boolean) is\r\n begin\r\n a = 1\r\n end procedure b;\r\nend a;';
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("package body 2",input,actual);
assertAndCountTest("package body 2",input,actual);
@ -1343,19 +1353,32 @@ function IntegrationTest76() {
functionIntegrationTest77() {
functionIntegrationTest77() {
letsettings=GetDefaultSettings();
letsettings=GetDefaultSettings();
settings.SignAlignAll=true;
letinput="WHEN -2;\r\nSIGNAL +0;";
letinput="WHEN -2;\r\nSIGNAL +0;";
letactual=beautify(input,settings);
letactual=beautify(input,settings);
assertAndCountTest("negative sign and number",input,actual);
assertAndCountTest("negative sign and number after key word",input,actual);