aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/cpp11_decltype_runme.js
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/javascript/cpp11_decltype_runme.js')
-rw-r--r--Examples/test-suite/javascript/cpp11_decltype_runme.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/cpp11_decltype_runme.js b/Examples/test-suite/javascript/cpp11_decltype_runme.js
new file mode 100644
index 000000000..c067d9b55
--- /dev/null
+++ b/Examples/test-suite/javascript/cpp11_decltype_runme.js
@@ -0,0 +1,22 @@
+var cpp11_decltype = require("cpp11_decltype");
+
+a = new cpp11_decltype.A;
+a.i = 5;
+if (a.i != 5) {
+ throw new Error("Assignment to a.i failed.");
+}
+
+a.j = 10;
+if (a.j != 10) {
+ throw new Error("Assignment to a.j failed.");
+}
+
+b = a.get_number(5);
+if (b != 10) {
+ throw new Error("get_number(5) should return 10.");
+}
+
+b = a.get_number(6);
+if (b != 0) {
+ throw new Error("get_number(6) should return 0.");
+}