Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for check js include
- Loading branch information
Alexandr Il'ichev
committed
Aug 3, 2012
1 parent
dacb82b
commit 45990f6
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
echo "Run test" | ||
for i in {1..12} | ||
do | ||
echo "//Success including" >> test-include_$i.js | ||
|
||
done | ||
|
||
echo "Check not included files" | ||
../../jscollectd.js test-input.js > test-output.js | ||
grep "include(" test-output.js | ||
|
||
rm -rf test-include_* | ||
|
||
echo "Finish" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
include("test-include_1.js"); | ||
|
||
if (true) { | ||
include("test-include_2.js"); // if | ||
} else if (true) { | ||
include("test-include_3.js"); // if in alternate | ||
} else { | ||
include("test-include_4.js"); // alternate in alternate | ||
} | ||
|
||
for (var i = 0; i < 2; i++) { | ||
include("test-include_5.js"); // for | ||
} | ||
|
||
while (true) { | ||
include("test-include_6.js"); // while | ||
} | ||
|
||
switch ("a") { | ||
case "b": | ||
include("test-include_7.js"); // swithc - case | ||
default: | ||
include("test-include_8.js"); // switch - default | ||
} | ||
|
||
var a = include("test-include_9.js"); // in variable | ||
b = include("test-include_12.js"); // in variable without declaration | ||
function s() { | ||
include("test-include_10.js"); // in function | ||
} | ||
var c = function() { | ||
include("test-include_11.js"); // in variable with function | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* root: /home/rewle/jscollect/tests/01 */ | ||
/* test-input.js: begin [depth 0] */ | ||
/* test-include_1.js: begin [depth 1] */ | ||
//Success including | ||
//Success including | ||
//Success including | ||
/* test-include_1.js: end */ | ||
|
||
|
||
if (true) { | ||
/* test-include_2.js: begin [depth 1] */ | ||
//Success including | ||
//Success including | ||
//Success including | ||
/* test-include_2.js: end */ | ||
// if | ||
} else if (true) { | ||
include("test-include_3.js"); // if in alternate | ||
} else { | ||
include("test-include_4.js"); // alternate in alternate | ||
} | ||
|
||
for (var i = 0; i < 2; i++) { | ||
include("test-include_5.js"); // for | ||
} | ||
|
||
while (true) { | ||
include("test-include_6.js"); // while | ||
} | ||
|
||
switch ("a") { | ||
case "b": | ||
include("test-include_7.js"); // swithc - case | ||
default: | ||
include("test-include_8.js"); // switch - default | ||
} | ||
|
||
var a = include("test-include_9.js"); // in variable | ||
b = include("test-include_12.js"); // in variable without declaration | ||
function s() { | ||
include("test-include_10.js"); // in function | ||
} | ||
var c = function() { | ||
include("test-include_11.js"); // in variable with function | ||
} | ||
/* test-input.js: end */ |