From ffbed4edbddb404bbe5c6a7487b6dd48842e94bd Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 3 Jan 2012 17:08:32 +0000 Subject: [PATCH] Rolled wikitest.js functionality into tiddlywiki.js --- test.sh | 2 +- tiddlywiki.js | 33 ++++++++++++++++++++++++++++ wikitest.js | 60 --------------------------------------------------- 3 files changed, 34 insertions(+), 61 deletions(-) delete mode 100644 wikitest.js 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