import {expect} from "chai"
import {trimSpaces} from "../../../source/util/trimspaces.mjs";


describe('trimSpaces', function () {
    [
        // one stroke is escped by the javascript interpreter, the second stroke escapes the stroke
        [' value ', 'value'],
        [' value\\ ', 'value\\ '],
        ['\\ value\\ ', '\\ value\\ '],
        ['\ value\ ', 'value'],   
        ["   value \ ", 'value'], 

    ].forEach(function (data) {

        let a = data.shift()
        let b = data.shift()

        it('trimSpaces(' + JSON.stringify(a) + ') should return ' + JSON.stringify(b), function () {
            expect(trimSpaces(a)).to.be.equal(b);
        });
    });
});
    