Version 1
[yaffs-website] / node_modules / tsml / test.js
diff --git a/node_modules/tsml/test.js b/node_modules/tsml/test.js
new file mode 100644 (file)
index 0000000..dea560e
--- /dev/null
@@ -0,0 +1,64 @@
+const assert = require('assert')
+    , tsml   = require('./')
+
+
+assert.equal(
+    tsml`this is a string`
+  , 'this is a string'
+)
+
+
+assert.equal(
+    tsml`
+
+      this
+      is
+      a
+      string
+
+    `
+  , 'thisisastring'
+
+)
+
+
+assert.equal(
+    tsml`
+
+      this 
+      is 
+      a 
+      string 
+
+    `
+  , 'this is a string '
+
+)
+
+
+assert.equal(
+    tsml`
+
+      this ${1} 
+      is 
+      ${2} a 
+      string 
+      ${true} 
+      ${1 + 2}
+    `
+  , 'this 1 is 2 a string true 3'
+)
+
+
+assert.equal(
+    tsml`
+
+      this ${1} 
+    is 
+  ${2} a 
+string 
+  ${true} 
+    ${1 + 2}
+`
+  , 'this 1 is 2 a string true 3'
+)