Remove obsolete wikitest command

This commit is contained in:
Jeremy Ruston 2013-01-16 13:44:27 +00:00
parent 83b99bc917
commit 0e2a0068e5
27 changed files with 0 additions and 170 deletions

View File

@ -1,74 +0,0 @@
/*\
title: $:/core/modules/commands/wikitest.js
type: application/javascript
module-type: command
wikitest command
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "wikitest",
synchronous: true
};
var Command = function(params,commander) {
this.params = params;
this.commander = commander;
};
Command.prototype.execute = function() {
if(this.params.length <1) {
return "Missing parameters";
}
var fs = require("fs"),
path = require("path"),
testdirectory = this.params[0],
saveResults = this.params[1] === "save",
files = fs.readdirSync(testdirectory),
titles = [],
f,t,extname,basename;
for(f=0; f<files.length; f++) {
extname = path.extname(files[f]);
if(extname === ".tid") {
var tiddlers = this.commander.wiki.deserializeTiddlers(extname,fs.readFileSync(path.resolve(testdirectory,files[f]),"utf8"));
if(tiddlers.length > 1) {
throw "Cannot use .JSON files";
}
this.commander.wiki.addTiddler(new $tw.Tiddler(tiddlers[0]));
titles.push(tiddlers[0].title);
}
}
for(t=0; t<titles.length; t++) {
var htmlFilename = path.resolve(testdirectory,titles[t] + ".html"),
plainFilename = path.resolve(testdirectory,titles[t] + ".txt"),
htmlTarget = fs.readFileSync(htmlFilename,"utf8"),
plainTarget = fs.readFileSync(plainFilename,"utf8"),
tiddler = this.commander.wiki.getTiddler(titles[t]),
htmlRender = this.commander.wiki.renderTiddler("text/html",titles[t]),
plainRender = this.commander.wiki.renderTiddler("text/plain",titles[t]);
if(saveResults) {
// Save results
fs.writeFileSync(htmlFilename,htmlRender,"utf8");
fs.writeFileSync(plainFilename,plainRender,"utf8");
} else {
// Report results
if(htmlTarget !== htmlRender) {
this.commander.streams.output.write("Tiddler " + titles[t] + " html error\nTarget: " + htmlTarget + "\nFound: " + htmlRender +"\n");
}
if(plainTarget !== plainRender) {
this.commander.streams.output.write("Tiddler " + titles[t] + " plain text error\nTarget: " + plainTarget + "\nFound: " + plainRender + "\n");
}
}
}
return null; // No error
};
exports.Command = Command;
})();

View File

@ -1,10 +0,0 @@
title: WikiTestCommand
tags: docs command
Run wikification tests against the tiddlers in the given directory. Include the `save` flag to save the test result files as the new targets.
{{{
--wikitest <dir> [save]
}}}
`--wikitest` looks for `*.tid` files in the specified folder. It then wikifies the tiddlers to both "text/plain" and "text/html" format and checks the results against the content of the `*.html` and `*.txt` files in the same directory.

16
run.sh
View File

@ -1,16 +0,0 @@
#!/bin/bash
# run TiddlyWiki5
pushd editions/tw5.com > /dev/null
node ../../tiddlywiki.js \
--verbose \
--wikitest ../../tests/wikitests/ \
|| exit 1
popd > /dev/null
# run jshint
jshint core
jshint plugins

View File

@ -1 +0,0 @@
<span class=''>SixthTiddler<br>11 February 2011<br><a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='Jermolene'>Jermolene</a><br></span><br><span class=''>SixthTiddler<br>11 February 2011<br><a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='Jermolene'>Jermolene</a><br></span><br><span class=''>EighthTiddler<br><br><br></span><br><span class=''>FirstTiddler<br><br><br></span><br>

View File

@ -1,7 +0,0 @@
title: EighthTiddler
type: text/x-tiddlywiki
<<tiddler SixthTiddler>>
<<tiddler target:SixthTiddler>>
<<tiddler template:SixthTiddler>>
<<tiddler template:SixthTiddler target:FirstTiddler>>

View File

@ -1 +0,0 @@
SixthTiddler11 February 2011JermoleneSixthTiddler11 February 2011JermoleneEighthTiddlerFirstTiddler

View File

@ -1 +0,0 @@
<table class='table'><caption align='top'>A caption above the table</caption><thead><tr class='evenRow'><td align='center'>Left</td><td align='center'>Middle</td><td align='center'>Right</td></tr></thead><tbody><tr class='oddRow'><td>North West</td><td>North</td><td>North East</td></tr><tr class='evenRow'><td>West</td><td>Here</td><td>East</td></tr><tr class='oddRow'><td>South West</td><td>South</td><td>South East</td></tr></tbody></table>

View File

@ -1,8 +0,0 @@
title: Fifth Tiddler
type: text/x-tiddlywiki
|A caption above the table|c
| Left | Middle | Right |h
|North West|North|North East|
|West|Here|East|
|South West|South|South East|

View File

@ -1 +0,0 @@
A caption above the tableLeftMiddleRightNorth WestNorthNorth EastWestHereEastSouth WestSouthSouth East

View File

@ -1 +0,0 @@
This is the <strong>text</strong> of the first tiddler, with a <span style='font-size:8em;color:red;'>link</span> to the <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='SecondTiddler'>SecondTiddler</a>, too. And a link to <a class='tw-tiddlylink tw-tiddlylink-external' href='http://tiddlywiki.com/'>http://tiddlywiki.com/</a>.<br>

View File

@ -1,4 +0,0 @@
title: FirstTiddler
type: text/x-tiddlywiki
This is the ''text'' of the first tiddler, with a @@font-size:8em;color:red;link@@ to the SecondTiddler, too. And a link to http://tiddlywiki.com/.

View File

@ -1 +0,0 @@
This is the text of the first tiddler, with a link to the SecondTiddler, too. And a link to http://tiddlywiki.com/.

View File

@ -1 +0,0 @@
A missing image <img src='Something.jpg'> and a $1 couple of &#xc7; &#199; &quot;HTML Entity&quot;

View File

@ -1,4 +0,0 @@
title: Fourth Tiddler
type: text/x-tiddlywiki
A missing image [img[Something.jpg]] and a $1 couple of &#xc7; &#199; &quot;HTML Entity&quot;

View File

@ -1 +0,0 @@
A missing image and a $1 couple of Ç Ç "HTML Entity"

View File

@ -1 +0,0 @@
<h2>Heading</h2>This is the second tiddler. It has a list:<br><ul><li> Item one</li><li> Item two</li><li> Item three</li></ul>And a macro invocation 5.0.0-alpha.8 and a <span class='myClass'>custom class</span><br>

View File

@ -1,9 +0,0 @@
title: SecondTiddler
type: text/x-tiddlywiki
!!Heading
This is the second tiddler. It has a list:
* Item one
* Item two
* Item three
And a macro invocation <<version>> and a {{myClass{custom class}}}

View File

@ -1 +0,0 @@
HeadingThis is the second tiddler. It has a list: Item one Item two Item threeAnd a macro invocation 5.0.0-alpha.8 and a custom class

View File

@ -1 +0,0 @@
4<br><br>SeventhTiddler<br><br>window<br>

View File

@ -1,8 +0,0 @@
title: SeventhTiddler
type: text/x-tiddlywiki
<<echo {{2+2}}>>
<<echo {{tiddler.title}}>>
<<echo {{"window"}}>>

View File

@ -1 +0,0 @@
4SeventhTiddlerwindow

View File

@ -1 +0,0 @@
SixthTiddler<br>11 February 2011<br><a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='Jermolene'>Jermolene</a><br>

View File

@ -1,8 +0,0 @@
title: SixthTiddler
type: text/x-tiddlywiki
modified: 20110211110621
modifier: Jermolene
<<view title>>
<<view modified date>>
<<view modifier link>>

View File

@ -1 +0,0 @@
SixthTiddler11 February 2011Jermolene

View File

@ -1 +0,0 @@
An explicit link <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='Fourth%20Tiddler'>Fourth Tiddler</a> and <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='Fourth%20Tiddler'>a pretty link</a> and a transclusion <span class=''>A missing image <img src='Something.jpg'> and a Stringy couple of &#xc7; &#199; &quot;HTML Entity&quot;</span><br><br><img src='http://placehold.it/350x150'><br>

View File

@ -1,6 +0,0 @@
title: ThirdTiddler
type: text/x-tiddlywiki
An explicit link [[Fourth Tiddler]] and [[a pretty link|Fourth Tiddler]] and a transclusion <<tiddler [[Fourth Tiddler]] with:Stringy>>
[img[http://placehold.it/350x150]]

View File

@ -1 +0,0 @@
An explicit link Fourth Tiddler and a pretty link and a transclusion A missing image and a Stringy couple of Ç Ç "HTML Entity"