/**
* Tests unordered list formatter
*
* Copyright (C) 2010-2019 R-T Specialty, LLC.
*
* This file is part of liza.
*
* liza is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
var liza = require( '../../../' ),
Sut = liza.validate.formatter.UnorderedList,
EchoFormatter = liza.validate.formatter.EchoFormatter,
common = require( './common' );
describe( 'UnorderedList', function()
{
common.testValidate( EchoFormatter.use( Sut )(), {
"": [ "", "" ],
"no semi": [ "no semi", "
" ],
"semi; colon": [
"semi; colon",
""
],
"semi;colon": [
"semi; colon",
""
],
"semi; colon": [
"semi; colon",
""
],
"semi ; colon": [
"semi; colon",
""
],
"semi ;colon": [
"semi; colon",
""
],
"semi;;;colon": [
"semi; colon",
""
],
"semi ; ;; colon": [
"semi; colon",
""
],
";semi;colon": [
"semi; colon",
""
],
";semi": [
"semi",
""
],
" ; semi": [
"semi",
""
],
"semi;colon;": [
"semi; colon",
""
],
";semi;": [
"semi",
""
],
"semi;": [
"semi",
""
],
"semi ; ": [
"semi",
""
],
";": [
"",
""
],
" ; ": [
"",
""
],
// single
"": [
"no semi",
""
],
// multi
"": [
"semi; colon",
""
],
// ensure that all li elements are replaced globally
"": [
"foo; bar; baz",
""
],
// extra whitespace
" ": [
"semi; colon",
""
],
// malformed
" semi colon ": [
"semi; colon",
""
],
// malformed
" no semi ": [
"no semi",
""
],
// empty node
"": [
"no semi",
""
],
// implementation consequence; no way to escape a semicolon
"": [
"semi; colon",
""
],
} );
common.testMixin(
EchoFormatter,
Sut,
'foo;',
'bar',
'foo; bar',
''
);
} );