diff --git a/test/relative/index.js b/test/relative/index.js new file mode 100644 index 0000000..7905cb0 --- /dev/null +++ b/test/relative/index.js @@ -0,0 +1,8 @@ +'use strict'; +var expect = require("expect.js"); +expect( + require("../..") + .call({resourcePath: __dirname + '/tpl/question/question.tpl'}) + .indexOf("require('./choose/choose.tpl')") != -1 +).to.be(true); +console.log('通过'); \ No newline at end of file diff --git a/test/relative/tpl/question/choose/choose.tpl b/test/relative/tpl/question/choose/choose.tpl new file mode 100644 index 0000000..35f3ba6 --- /dev/null +++ b/test/relative/tpl/question/choose/choose.tpl @@ -0,0 +1,24 @@ +{{if body}} +
+

{{#body}}

+
+{{/if}} + \ No newline at end of file diff --git a/test/relative/tpl/question/question.tpl b/test/relative/tpl/question/question.tpl new file mode 100644 index 0000000..dbb8593 --- /dev/null +++ b/test/relative/tpl/question/question.tpl @@ -0,0 +1 @@ +{{include './choose/choose'}} \ No newline at end of file