diff --git a/test.js b/test.js index 1777400..ee170e3 100755 --- a/test.js +++ b/test.js @@ -702,128 +702,10 @@ var cases = test.Cases({ }, // text utils... - /* XXX might be a good idea to do a separate test suite for this to + // XXX might be a good idea to do a separate test suite for this to // be able to reference individual cases... // ...or to re-organize this thing differently.... // XXX still need to test tab_size values (0, ...) - text_cases: [ - // sanity checks... - { input: '', - all: ''}, - { input: 'abc', - all: 'abc'}, - { input: '\n\t\tabc', - all: 'abc'}, - - // NOTE: there is no way to know what is the indent of 'a' - // relative to the rest of the text... - { input: `a - c`, - text: 'a\nc', - doc: 'a\n c'}, - { input: `a\nc`, - text: 'a\nc', - doc: 'a\nc'}, - { input: `\ - a - c`, - all: 'a\n c'}, - { input: ` - a - c`, - all: 'a\n c'}, - { input: ` - a - c`, - all: 'a\n c' }, - - { input: `a - b - c`, - text: 'a\nb\nc', - doc: 'a\n b\n c' }, - - { input: ` - a - b - c`, - all: 'a\nb\n c' }, - { input: ` - a - b - c`, - all: 'a\n b\n c' }, - - { input: `a - b - c`, - all: `a\n b\nc` }, - { input: `a - b - c`, - all: `a\nb\n c` }, - { input: ` - a - b - c`, - all: `a\n b\n c` }, - { input: `a - b - b - b - c`, - all: `a\n b\n b\n b\nc` }, - { input: `a - b - b - b - c`, - all: `a\n b\n b\n b\nc` }, - { input: ` - a - b - c`, - all: `a\n b\nc` }, - { input: `a - b - c - d`, - text: `a\n b\nc\nd`, - // XXX not sure about this... - doc: `a\n b\n c\n d` }, - ], - text: function(assert){ - this.text_cases - .map(function({input, doc, text, all}, i){ - doc = doc != null ? - doc - : all - text = text != null ? - text - : all - - var test = function(func, input, expect){ - var res - return assert((res = object[func](input)) == expect, - func +'(text_cases['+i+']):' - +'\n---input---\n' - + (input instanceof Array ? - input[0] - : input) - +'\n---Expected---\n' - + expect - +'\n---Got---\n' - + res - +'\n---') } - - doc != null - && test('normalizeIndent', input, doc) - && test('doc', [input], doc) - text != null - && test('normalizeTextIndent', input, text) - && test('text', [input], text) }) }, - //*/ - // XXX naming is not clear -- should be close to automatic... // XXX still need to test tab_size values (0, ...) // sanity checks...