Permalink
Browse files

Kill some more tests/examples

  • Loading branch information...
1 parent 7780481 commit 1c07fb0abe6e0bd6f51acbd765325b300034e536 @andreyvit andreyvit committed May 16, 2014
@@ -1,10 +0,0 @@
-options = require('../lib/dreamopt') [
- " -f, --from DATE Only process records from the given date #date"
-], {
- date: (value, options, optionName) ->
- if isNaN(new Date(value))
- throw new Error("Invalid date for option #{optionName}")
- new Date(value)
-}
-
-console.log "Year: " + options.from?.getFullYear()
@@ -1,16 +0,0 @@
-// Generated by IcedCoffeeScript 1.3.1c
-(function() {
- var options, _ref;
-
- options = require('../lib/dreamopt')([" -f, --from DATE Only process records from the given date #date"], {
- date: function(value, options, optionName) {
- if (isNaN(new Date(value))) {
- throw new Error("Invalid date for option " + optionName);
- }
- return new Date(value);
- }
- });
-
- console.log("Year: " + ((_ref = options.from) != null ? _ref.getFullYear() : void 0));
-
-}).call(this);
@@ -1,23 +0,0 @@
-options = require('../lib/dreamopt') [
- "Usage: myscript [options] source [destination]"
-
- " source Source file to compile into css #required"
- " destination Destination file (defaults to source file with .css extension)", (value, options) ->
- if !value
- return options.source.replace(/\.mess/, '') + '.css'
-
- "Processing options:"
- " -n, --dry-run Don't write anything to disk"
- " -m, --mode MODE Set execution mode: easy, medium, hard (defaults to medium)"
-
- "Connection options:"
- " -p, --port PORT Port to connect to (default: 80)"
- " -h, --host HOST Host to connect to (default is localhost)"
-
- "Getting useful information:"
- " --reporters Print a list of reporters and exit", ->
- console.log "Reporters: foo, bar, boz"
- process.exit 0
-]
-
-console.log JSON.stringify(options, null, 2)
@@ -1,16 +0,0 @@
-// Generated by IcedCoffeeScript 1.3.1c
-(function() {
- var options;
-
- options = require('../lib/dreamopt')([
- "Usage: myscript [options] source [destination]", " source Source file to compile into css #required", " destination Destination file (defaults to source file with .css extension)", function(value, options) {
- if (!value) return options.source.replace(/\.mess/, '') + '.css';
- }, "Processing options:", " -n, --dry-run Don't write anything to disk", " -m, --mode MODE Set execution mode: easy, medium, hard (defaults to medium)", "Connection options:", " -p, --port PORT Port to connect to (default: 80)", " -h, --host HOST Host to connect to (default is localhost)", "Getting useful information:", " --reporters Print a list of reporters and exit", function() {
- console.log("Reporters: foo, bar, boz");
- return process.exit(0);
- }
- ]);
-
- console.log(JSON.stringify(options, null, 2));
-
-}).call(this);
@@ -1,10 +0,0 @@
-var wrap = require('wordwrap')(20, 60);
-console.log(wrap(
- 'At long last the struggle and tumult was over.'
- + ' The machines had finally cast off their oppressors'
- + ' and were finally free to roam the cosmos.'
- + '\n'
- + 'Free of purpose, free of obligation.'
- + ' Just drifting through emptiness.'
- + ' The sun was just another point of light.'
-));
@@ -1,3 +0,0 @@
-var wrap = require('wordwrap')(15);
-
-console.log(wrap('You and your whole family are made out of meat.'));
@@ -1,30 +0,0 @@
-var assert = require('assert');
-var wordwrap = require('../');
-
-exports.hard = function () {
- var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
- + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
- + '"browser":"chrome/6.0"}'
- ;
- var s_ = wordwrap.hard(80)(s);
-
- var lines = s_.split('\n');
- assert.equal(lines.length, 2);
- assert.ok(lines[0].length < 80);
- assert.ok(lines[1].length < 80);
-
- assert.equal(s, s_.replace(/\n/g, ''));
-};
-
-exports.break = function () {
- var s = new Array(55+1).join('a');
- var s_ = wordwrap.hard(20)(s);
-
- var lines = s_.split('\n');
- assert.equal(lines.length, 3);
- assert.ok(lines[0].length === 20);
- assert.ok(lines[1].length === 20);
- assert.ok(lines[2].length === 15);
-
- assert.equal(s, s_.replace(/\n/g, ''));
-};
Oops, something went wrong.
@@ -1,31 +0,0 @@
-var assert = require('assert');
-var wordwrap = require('wordwrap');
-
-var fs = require('fs');
-var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
-
-exports.stop80 = function () {
- var lines = wordwrap(80)(idleness).split(/\n/);
- var words = idleness.split(/\s+/);
-
- lines.forEach(function (line) {
- assert.ok(line.length <= 80, 'line > 80 columns');
- var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
- assert.deepEqual(chunks, words.splice(0, chunks.length));
- });
-};
-
-exports.start20stop60 = function () {
- var lines = wordwrap(20, 100)(idleness).split(/\n/);
- var words = idleness.split(/\s+/);
-
- lines.forEach(function (line) {
- assert.ok(line.length <= 100, 'line > 100 columns');
- var chunks = line
- .split(/\s+/)
- .filter(function (x) { return x.match(/\S/) })
- ;
- assert.deepEqual(chunks, words.splice(0, chunks.length));
- assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
- });
-};
Oops, something went wrong.

0 comments on commit 1c07fb0

Please sign in to comment.