'use strict';

import {expect} from "chai"
import {fromBinary, toBinary} from "../../../source/types/binary.mjs";

describe('Binary', function () {

    [
        ['a', 'a\u0000'],
        ['☹', '9&'],
        ['Iñtërnâtiônàlizætiøn', 'I\u0000ñ\u0000t\u0000ë\u0000r\u0000n\u0000â\u0000t\u0000i\u0000ô\u0000n\u0000à\u0000l\u0000i\u0000z\u0000æ\u0000t\u0000i\u0000ø\u0000n\u0000']

    ].forEach(function (data) {

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

        it('fromBinary(toBinary(' + a + ')) should work', function () {
            let r = toBinary(a);
            expect(r).to.be.equal(b);
            expect(fromBinary(r)).to.be.equal(a);
        })

    });


});