Commits

Scott Koon  committed c9427d5

Added test for duplicate checking. Still making it work though

  • Participants
  • Parent commits 1d32df8

Comments (0)

Files changed (2)

File bootstrap_test.html

 <script type="text/javascript">
     var callbackCalled = false;
     bootstrap("test.js","test", function(){ callbackCalled = true; testSuite.run() });
-    $b( "test2.js" );
+    $b("test2.js");
     $b("test.css");
+    $b("test.js");
+
 </script>
 </body>
 </html>
 testSuite.add(function() {
     var scripts = document.getElementsByTagName("script");
     for(var i = 0;i< scripts.length;i++) {
-        if( scripts[i].src = "test2.js" ) { return true; }
+        if( scripts[i].src == "test2.js" ) { return true; }
     }
     return false;    
 }
 }
         , "Was the callback called?"
         , "The callback was not called.");
+
+testSuite.add(function() {
+    var nl = document.getElementsByTagName("script");
+    var count = 0;
+    var l = nl.length;
+    for(var c =0;c<l;c++) {
+        if("src" in nl[c] && nl[c].src == "test.js")
+            count++;
+    }
+    return (count==1);
+}
+        , "Was test.js loaded twice?"
+        , "test.js was only loaded once");