[seed] Tests: new test which tests various parts of the importer, including something which is currently br



commit d6de7e0060d6ae2eda59a52ca029af0114951e31
Author: Tim Horton <hortont svn gnome org>
Date:   Wed Jun 3 20:39:17 2009 -0400

    Tests: new test which tests various parts of the importer, including something which is currently broken. My email to Robb explaining it is attached.
    
    create a directory, say, asdf
    
    put two files in asdf:
    
    asdf/a.js:
    
    imports.searchPath.unshift("/home/hortont/Desktop/asdf");
    Clutter = imports.gi.Clutter;
    b = imports.b;
    
    asdf/b.js:
    
    Clutter = imports.gi.Clutter;
    print("asdf");
    
    go to the directory above asdf, then run
    
    seed asdf/a.js
    
    note that the print statement is never run... but if you don't import Clutter in both of them, it doesn't break.
---
 configure.ac                             |    1 +
 tests/javascript/Makefile.am             |    3 ++-
 tests/javascript/importer-search-path.js |    7 +++++++
 tests/javascript/searchpath/Makefile.am  |    1 +
 tests/javascript/searchpath/a.js         |    9 +++++++++
 tests/javascript/searchpath/b.js         |    8 ++++++++
 6 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 153ffe6..a44a969 100644
--- a/configure.ac
+++ b/configure.ac
@@ -381,6 +381,7 @@ extensions/Makefile
 tests/Makefile
 tests/javascript/Makefile
 tests/javascript/gtypes/Makefile
+tests/javascript/searchpath/Makefile
 tests/javascript/signals/Makefile
 tests/javascript/structs/Makefile
 tests/c/Makefile
diff --git a/tests/javascript/Makefile.am b/tests/javascript/Makefile.am
index b0a3274..6a3a3d9 100644
--- a/tests/javascript/Makefile.am
+++ b/tests/javascript/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = gtypes signals structs
+SUBDIRS = gtypes signals structs searchpath
 
 EXTRA_DIST = \
     COPYING \
@@ -21,6 +21,7 @@ EXTRA_DIST = \
     gvalue-argument.js \
     include.js \
     include-syntax.js \
+    importer-search-path.js \
     introspect.js \
     json-constructor.js \
     json.js \
diff --git a/tests/javascript/importer-search-path.js b/tests/javascript/importer-search-path.js
new file mode 100755
index 0000000..33eb043
--- /dev/null
+++ b/tests/javascript/importer-search-path.js
@@ -0,0 +1,7 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:b
+// STDERR:
+
+a = imports.searchpath.a;
diff --git a/tests/javascript/searchpath/Makefile.am b/tests/javascript/searchpath/Makefile.am
new file mode 100644
index 0000000..e43ac26
--- /dev/null
+++ b/tests/javascript/searchpath/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = a.js b.js
diff --git a/tests/javascript/searchpath/a.js b/tests/javascript/searchpath/a.js
new file mode 100755
index 0000000..484956c
--- /dev/null
+++ b/tests/javascript/searchpath/a.js
@@ -0,0 +1,9 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:b
+// STDERR:
+
+imports.searchPath.unshift("searchpath");
+GObject = imports.gi.GObject;
+b = imports.b;
diff --git a/tests/javascript/searchpath/b.js b/tests/javascript/searchpath/b.js
new file mode 100755
index 0000000..12fd83d
--- /dev/null
+++ b/tests/javascript/searchpath/b.js
@@ -0,0 +1,8 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:b
+// STDERR:
+
+GObject = imports.gi.GObject;
+print("b");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]