xultestrunner 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/.document +5 -0
  2. data/.gitignore +4 -1
  3. data/LICENSE +17 -18
  4. data/README.rdoc +18 -0
  5. data/Rakefile +65 -40
  6. data/VERSION +1 -1
  7. data/bin/xultest +1 -12
  8. data/lib/xultestrunner.rb +1 -1
  9. data/test/test_helper.rb +9 -0
  10. data/test/xultestrunner_test.rb +7 -0
  11. data/xpcomcore/app/application.ini +12 -0
  12. data/xpcomcore/app/chrome/chrome.manifest +1 -0
  13. data/xpcomcore/app/chrome/content/xul/main_window.xul +6 -0
  14. data/xpcomcore/app/components/bootstrapper.js +70 -0
  15. data/xpcomcore/app/defaults/preferences/prefs.js +7 -0
  16. data/xultestrunner.gemspec +21 -150
  17. metadata +27 -153
  18. data/.gitmodules +0 -3
  19. data/README +0 -17
  20. data/xulapp/application.ini +0 -9
  21. data/xulapp/chrome/chrome.manifest +0 -2
  22. data/xulapp/chrome/content/interface/boot.xul +0 -20
  23. data/xulapp/chrome/content/interface/testharness.html +0 -30
  24. data/xulapp/chrome/content/lib/xultestcase.js +0 -140
  25. data/xulapp/chrome/content/lib/xultestrunner.js +0 -120
  26. data/xulapp/chrome/content/vendor/prototype/LICENSE +0 -16
  27. data/xulapp/chrome/content/vendor/prototype/prototype.js +0 -4874
  28. data/xulapp/chrome/content/vendor/scriptaculous/LICENSE +0 -20
  29. data/xulapp/chrome/content/vendor/scriptaculous/test.css +0 -90
  30. data/xulapp/chrome/content/vendor/scriptaculous/unittest.js +0 -566
  31. data/xulapp/chrome/content/vendor/xpcomcore/LICENSE +0 -21
  32. data/xulapp/chrome/content/vendor/xpcomcore/README +0 -27
  33. data/xulapp/chrome/content/vendor/xpcomcore/Rakefile +0 -83
  34. data/xulapp/chrome/content/vendor/xpcomcore/VERSION.yml +0 -5
  35. data/xulapp/chrome/content/vendor/xpcomcore/bootstrapper.js +0 -32
  36. data/xulapp/chrome/content/vendor/xpcomcore/components/XPCOMCore.js +0 -120
  37. data/xulapp/chrome/content/vendor/xpcomcore/doc/files.html +0 -241
  38. data/xulapp/chrome/content/vendor/xpcomcore/doc/index.html +0 -243
  39. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Error.html +0 -256
  40. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Kernel.html +0 -1030
  41. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/LoadError.html +0 -319
  42. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/SelfConceptError.html +0 -319
  43. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/_global_.html +0 -316
  44. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_file.js.html +0 -53
  45. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_kernel.js.html +0 -251
  46. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
  47. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
  48. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
  49. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
  50. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
  51. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
  52. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
  53. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
  54. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
  55. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
  56. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
  57. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
  58. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
  59. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
  60. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
  61. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
  62. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
  63. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
  64. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
  65. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
  66. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
  67. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
  68. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
  69. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
  70. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
  71. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
  72. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
  73. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
  74. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
  75. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
  76. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
  77. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
  78. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
  79. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
  80. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
  81. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
  82. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
  83. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
  84. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
  85. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
  86. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
  87. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
  88. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
  89. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
  90. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
  91. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
  92. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
  93. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
  94. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
  95. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
  96. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
  97. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
  98. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
  99. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
  100. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
  101. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
  102. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
  103. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
  104. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
  105. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
  106. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
  107. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
  108. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
  109. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
  110. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
  111. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
  112. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
  113. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
  114. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
  115. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
  116. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
  117. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
  118. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
  119. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
  120. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
  121. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
  122. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
  123. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
  124. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
  125. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
  126. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
  127. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
  128. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
  129. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
  130. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
  131. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
  132. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
  133. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
  134. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
  135. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
  136. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
  137. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
  138. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  139. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
  140. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
  141. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  142. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  143. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
  144. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
  145. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
  146. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
  147. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
  148. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
  149. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
  150. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
  151. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
  152. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
  153. data/xulapp/chrome/content/vendor/xpcomcore/lib/file.js +0 -46
  154. data/xulapp/chrome/content/vendor/xpcomcore/lib/kernel.js +0 -244
  155. data/xulapp/chrome/content/vendor/xpcomcore/test/file_test.js +0 -16
  156. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/love.js +0 -1
  157. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_love.js +0 -1
  158. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_world.js +0 -1
  159. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/syntax_error.js +0 -1
  160. data/xulapp/chrome/content/vendor/xpcomcore/test/kernel_test.js +0 -88
  161. data/xulapp/components/bootstrap.js +0 -93
  162. data/xulapp/defaults/preferences/prefs.js +0 -14
@@ -1,93 +0,0 @@
1
- /**
2
- @name String
3
- @class Additions to the core string object.
4
- */
5
-
6
- /** @author Steven Levithan, released as public domain. */
7
- String.prototype.trim = function() {
8
- var str = this.replace(/^\s+/, '');
9
- for (var i = str.length - 1; i >= 0; i--) {
10
- if (/\S/.test(str.charAt(i))) {
11
- str = str.substring(0, i + 1);
12
- break;
13
- }
14
- }
15
- return str;
16
- }
17
- /*t:
18
- plan(6, "Testing String.prototype.trim.");
19
-
20
- var s = " a bc ".trim();
21
- is(s, "a bc", "multiple spaces front and back are trimmed.");
22
-
23
- s = "a bc\n\n".trim();
24
- is(s, "a bc", "newlines only in back are trimmed.");
25
-
26
- s = "\ta bc".trim();
27
- is(s, "a bc", "tabs only in front are trimmed.");
28
-
29
- s = "\n \t".trim();
30
- is(s, "", "an all-space string is trimmed to empty.");
31
-
32
- s = "a b\nc".trim();
33
- is(s, "a b\nc", "a string with no spaces in front or back is trimmed to itself.");
34
-
35
- s = "".trim();
36
- is(s, "", "an empty string is trimmed to empty.");
37
-
38
- */
39
-
40
- String.prototype.balance = function(open, close) {
41
- var i = 0;
42
- while (this.charAt(i) != open) {
43
- if (i == this.length) return [-1, -1];
44
- i++;
45
- }
46
-
47
- var j = i+1;
48
- var balance = 1;
49
- while (j < this.length) {
50
- if (this.charAt(j) == open) balance++;
51
- if (this.charAt(j) == close) balance--;
52
- if (balance == 0) break;
53
- j++;
54
- if (j == this.length) return [-1, -1];
55
- }
56
-
57
- return [i, j];
58
- }
59
- /*t:
60
- plan(16, "Testing String.prototype.balance.");
61
-
62
- var s = "{abc}".balance("{","}");
63
- is(s[0], 0, "opener in first is found.");
64
- is(s[1], 4, "closer in last is found.");
65
-
66
- s = "ab{c}de".balance("{","}");
67
- is(s[0], 2, "opener in middle is found.");
68
- is(s[1], 4, "closer in middle is found.");
69
-
70
- s = "a{b{c}de}f".balance("{","}");
71
- is(s[0], 1, "nested opener is found.");
72
- is(s[1], 8, "nested closer is found.");
73
-
74
- s = "{}".balance("{","}");
75
- is(s[0], 0, "opener with no content is found.");
76
- is(s[1], 1, "closer with no content is found.");
77
-
78
- s = "".balance("{","}");
79
- is(s[0], -1, "empty string opener is -1.");
80
- is(s[1], -1, "empty string closer is -1.");
81
-
82
- s = "{abc".balance("{","}");
83
- is(s[0], -1, "opener with no closer returns -1.");
84
- is(s[1], -1, "no closer returns -1.");
85
-
86
- s = "abc".balance("{","}");
87
- is(s[0], -1, "no opener or closer returns -1 for opener.");
88
- is(s[1], -1, "no opener or closer returns -1 for closer.");
89
-
90
- s = "a<bc}de".balance("<","}");
91
- is(s[0], 1, "unmatching opener is found.");
92
- is(s[1], 4, "unmatching closer is found.");
93
- */
@@ -1,129 +0,0 @@
1
- /**
2
- * @fileOverview
3
- * @name JsTestrun
4
- * @author Michael Mathews micmath@gmail.com
5
- * @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/trunk/jsdoc-toolkit/app/frame/Testrun.js $
6
- * @revision $Id: Testrun.js 418 2008-01-15 21:40:33Z micmath $
7
- * @license <a href="http://en.wikipedia.org/wiki/MIT_License">X11/MIT License</a>
8
- * (See the accompanying README file for full details.)
9
- */
10
-
11
- /**
12
- Yet another unit testing tool for JavaScript.
13
- @author Michael Mathews <a href="mailto:micmath@gmail.com">micmath@gmail.com</a>
14
- @param {object} testCases Properties are testcase names, values are functions to execute as tests.
15
- */
16
- function testrun(testCases) {
17
- var ran = 0;
18
- for (t in testCases) {
19
- var result = testCases[t]();
20
- ran++;
21
- }
22
-
23
- return testrun.reportOut+"-------------------------------\n"+((testrun.fails>0)? ":( Failed "+testrun.fails+"/" : ":) Passed all ")+testrun.count+" test"+((testrun.count == 1)? "":"s")+".\n";
24
- }
25
-
26
-
27
- testrun.count = 0;
28
- testrun.current = null;
29
- testrun.passes = 0;
30
- testrun.fails = 0;
31
- testrun.reportOut = "";
32
-
33
- /** @private */
34
- testrun.report = function(text) {
35
- testrun.reportOut += text+"\n";
36
- }
37
-
38
- /**
39
- Check if test evaluates to true.
40
- @param {string} test To be evaluated.
41
- @param {string} message Optional. To be displayed in the report.
42
- @return {boolean} True if the string test evaluates to true.
43
- */
44
- ok = function(test, message) {
45
- testrun.count++;
46
-
47
- var result;
48
- try {
49
- result = eval(test);
50
-
51
- if (result) {
52
- testrun.passes++;
53
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
54
- }
55
- else {
56
- testrun.fails++;
57
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
58
- }
59
- }
60
- catch(e) {
61
- testrun.fails++
62
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
63
-
64
- }
65
- }
66
-
67
- /**
68
- Check if test is same as expected.
69
- @param {string} test To be evaluated.
70
- @param {string} expected
71
- @param {string} message Optional. To be displayed in the report.
72
- @return {boolean} True if (test == expected). Note that the comparison is not a strict equality check.
73
- */
74
- is = function(test, expected, message) {
75
- testrun.count++;
76
-
77
- var result;
78
- try {
79
- result = eval(test);
80
-
81
- if (result == expected) {
82
- testrun.passes++
83
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
84
- }
85
- else {
86
- testrun.fails++
87
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
88
- testrun.report("expected: "+expected);
89
- testrun.report(" got: "+result);
90
- }
91
- }
92
- catch(e) {
93
- testrun.fails++
94
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
95
- testrun.report("expected: "+expected);
96
- testrun.report(" got: "+result);}
97
- }
98
-
99
- /**
100
- Check if test matches pattern.
101
- @param {string} test To be evaluated.
102
- @param {string} pattern Used to create a RegExp.
103
- @param {string} message Optional. To be displayed in the report.
104
- @return {boolean} True if test matches pattern.
105
- */
106
- like = function(test, pattern, message) {
107
- testrun.count++;
108
-
109
- var result;
110
- try {
111
- result = eval(test);
112
- var rgx = new RegExp(pattern);
113
-
114
- if (rgx.test(result)) {
115
- testrun.passes++
116
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
117
- }
118
- else {
119
- testrun.fails++
120
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
121
- testrun.report(" this: "+result);
122
- testrun.report("is not like: "+pattern);
123
- }
124
- }
125
- catch(e) {
126
- testrun.fails++
127
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
128
- }
129
- }
@@ -1,33 +0,0 @@
1
- IO.include("frame/Opt.js");
2
- IO.include("frame/Chain.js");
3
- IO.include("frame/Link.js");
4
- IO.include("frame/String.js");
5
- IO.include("frame/Hash.js");
6
- IO.include("frame/Namespace.js");
7
- //IO.include("frame/Reflection.js");
8
-
9
- /** A few helper functions to make life a little easier. */
10
-
11
- function defined(o) {
12
- return (o !== undefined);
13
- }
14
-
15
- function copy(o) { // todo check for circular refs
16
- if (o == null || typeof(o) != 'object') return o;
17
- var c = new o.constructor();
18
- for(var p in o) c[p] = copy(o[p]);
19
- return c;
20
- }
21
-
22
- function isUnique(arr) {
23
- var l = arr.length;
24
- for(var i = 0; i < l; i++ ) {
25
- if (arr.lastIndexOf(arr[i]) > i) return false;
26
- }
27
- return true;
28
- }
29
-
30
- /** Returns the given string with all regex meta characters backslashed. */
31
- RegExp.escapeMeta = function(str) {
32
- return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
33
- }
@@ -1,26 +0,0 @@
1
- /**
2
- This is the main container for the FOODOC handler.
3
- @namespace
4
- */
5
- FOODOC = {
6
- };
7
-
8
- /** The current version string of this application. */
9
- FOODOC.VERSION = "1.0";
10
-
11
- FOODOC.handle = function(srcFile, src) {
12
- LOG.inform("Handling file '" + srcFile + "'");
13
-
14
- return [
15
- new JSDOC.Symbol(
16
- "foo",
17
- [],
18
- "VIRTUAL",
19
- new JSDOC.DocComment("/** This is a foo. */")
20
- )
21
- ];
22
- };
23
-
24
- FOODOC.publish = function(symbolgroup) {
25
- LOG.inform("Publishing symbolgroup.");
26
- };
@@ -1,159 +0,0 @@
1
- LOG.inform("XMLDOC.DomReader loaded");
2
-
3
- XMLDOC.DomReader = function(root) {
4
-
5
- this.dom = root;
6
-
7
- /**
8
- * The current node the reader is on
9
- */
10
- this.node = root;
11
-
12
- /**
13
- * Get the current node the reader is on
14
- * @type XMLDOC.Parser.node
15
- */
16
- XMLDOC.DomReader.prototype.getNode = function() {
17
- return this.node;
18
- };
19
-
20
- /**
21
- * Set the node the reader should be positioned on.
22
- * @param node {XMLDOC.Parser.node}
23
- */
24
- XMLDOC.DomReader.prototype.setNode = function(node) {
25
- this.node = node;
26
- };
27
-
28
- /**
29
- * A helper method to make sure the current node will
30
- * never return null, unless null is passed as the root.
31
- * @param step {String} An expression to evaluate - should return a node or null
32
- */
33
- XMLDOC.DomReader.prototype.navigate = function(step) {
34
- var n;
35
- if ((n = step) != null)
36
- {
37
- this.node = n;
38
- return this.node;
39
- }
40
- return null;
41
- };
42
-
43
- /**
44
- * Get the root node of the current node's document.
45
- */
46
- XMLDOC.DomReader.prototype.root = function() {
47
- this.navigate(this.dom);
48
- };
49
-
50
- /**
51
- * Get the parent of the current node.
52
- */
53
- XMLDOC.DomReader.prototype.parent = function() {
54
- return this.navigate(this.node.parentNode());
55
- };
56
-
57
- /**
58
- * Get the first child of the current node.
59
- */
60
- XMLDOC.DomReader.prototype.firstChild = function() {
61
- return this.navigate(this.node.firstChild());
62
- };
63
-
64
- /**
65
- * Get the last child of the current node.
66
- */
67
- XMLDOC.DomReader.prototype.lastChild = function() {
68
- return this.navigate(this.node.lastChild());
69
- };
70
-
71
- /**
72
- * Get the next sibling of the current node.
73
- */
74
- XMLDOC.DomReader.prototype.nextSibling = function() {
75
- return this.navigate(this.node.nextSibling());
76
- };
77
-
78
- /**
79
- * Get the previous sibling of the current node.
80
- */
81
- XMLDOC.DomReader.prototype.prevSibling = function() {
82
- return this.navigate(this.node.prevSibling());
83
- };
84
-
85
- //===============================================================================================
86
- // Support methods
87
-
88
- /**
89
- * Walk the tree starting with the current node, calling the plug-in for
90
- * each node visited. Each time the plug-in is called, the DomReader
91
- * is passed as the only parameter. Use the {@link XMLDOC.DomReader#getNode} method
92
- * to access the current node. <i>This method uses a depth first traversal pattern.</i>
93
- *
94
- * @param srcFile {String} The source file being evaluated
95
- */
96
- XMLDOC.DomReader.prototype.getSymbols = function(srcFile)
97
- {
98
- XMLDOC.DomReader.symbols = [];
99
- XMLDOC.DomReader.currentFile = srcFile;
100
- JSDOC.Symbol.srcFile = (srcFile || "");
101
-
102
- if (defined(JSDOC.PluginManager)) {
103
- JSDOC.PluginManager.run("onDomGetSymbols", this);
104
- }
105
-
106
- return XMLDOC.DomReader.symbols;
107
- };
108
-
109
- /**
110
- * Find the node with the given name using a depth first traversal.
111
- * Does not modify the DomReader's current node.
112
- *
113
- * @param name {String} The name of the node to find
114
- * @return the node that was found, or null if not found
115
- */
116
- XMLDOC.DomReader.prototype.findNode = function(name)
117
- {
118
- var findNode = null;
119
-
120
- // Start at the current node and move into the subtree,
121
- // looking for the node with the given name
122
- function deeper(node, find)
123
- {
124
- var look = null;
125
-
126
- if (node) {
127
- if (node.name == find)
128
- {
129
- return node;
130
- }
131
-
132
- if (node.firstChild())
133
- {
134
- look = deeper(node.firstChild(), find);
135
- }
136
-
137
- if (!look && node.nextSibling())
138
- {
139
- look = deeper(node.nextSibling(), find);
140
- }
141
- }
142
-
143
- return look;
144
- }
145
-
146
- return deeper(this.getNode().firstChild(), name);
147
- };
148
-
149
- /**
150
- * Find the next node with the given name using a depth first traversal.
151
- *
152
- * @param name {String} The name of the node to find
153
- */
154
- XMLDOC.DomReader.prototype.findPreviousNode = function(name)
155
- {
156
- };
157
-
158
- };
159
-
@@ -1,16 +0,0 @@
1
- LOG.inform("XMLDOC.symbolize loaded");
2
-
3
- /**
4
- * Convert the source file to a set of symbols
5
- */
6
- XMLDOC.symbolize = function(srcFile, src) {
7
-
8
- LOG.inform("Symbolizing file '" + srcFile + "'");
9
-
10
- // XML files already have a defined structure, so we don't need to
11
- // do anything but parse them. The DOM reader can create a symbol
12
- // table from the parsed XML.
13
- var dr = new XMLDOC.DomReader(XMLDOC.Parser.parse(src));
14
- return dr.getSymbols(srcFile);
15
-
16
- };