diff --git a/test.sh b/test.sh index bb670db60..2344988c2 100755 --- a/test.sh +++ b/test.sh @@ -11,7 +11,7 @@ node tiddlywiki.js --recipe $PWD/test/tiddlywiki.2.6.5/source/tiddlywiki.com/ind diff tmp/newcooked/index.html test/tiddlywiki.2.6.5/target/index.2.6.5.html # Run the wikification tests -node wikitest.js test/wikitests/ +node tiddlywiki.js --wikitest test/wikitests/ jshint *.js jshint js diff --git a/tiddlywiki.js b/tiddlywiki.js index 6c8f5a7fb..46626503d 100644 --- a/tiddlywiki.js +++ b/tiddlywiki.js @@ -176,6 +176,39 @@ var commandLineSwitches = { handler: function(args,callback) { process.nextTick(function() {callback(null);}); } + }, + wikitest: { + args: {min: 1, max: 1}, + handler: function(args,callback) { + var testdirectory = args[0], + files = fs.readdirSync(testdirectory), + titles = [], + f,t,extname,basename; + for(f=0; f 1) { + throw "Cannot use .JSON files"; + } + app.store.addTiddler(new Tiddler(tiddlers[0])); + titles.push(tiddlers[0].title); + } + } + for(t=0; t - -This command creates a store and loads up all the `*.tid` files in the test directory. Then it wikifies each tiddler in turn, -verifying that the output matches `.html` and `.txt`. - -*/ - -/*jslint node: true */ -"use strict"; - -var App = require("./js/App.js").App, - Tiddler = require("./js/Tiddler.js").Tiddler, - WikiStore = require("./js/WikiStore.js").WikiStore, - WikiTextProcessor = require("./js/WikiTextProcessor.js").WikiTextProcessor, - tiddlerInput = require("./js/TiddlerInput.js"), - utils = require("./js/Utils.js"), - util = require("util"), - fs = require("fs"), - path = require("path"); - -var app = new App(); - -var testdirectory = process.argv[2], - files = fs.readdirSync(testdirectory), - titles = [], - f,t,extname,basename; - -for(f=0; f 1) { - throw "Cannot use .JSON files"; - } - app.store.addTiddler(new Tiddler(tiddlers[0])); - titles.push(tiddlers[0].title); - } -} - -for(t=0; t