/* eslint-disable no-irregular-whitespace */
import ava from 'ava'

const entrypoints = [
  '../dist',
  '../src',
]

const american = { locale: 'en-us' }
const fr = { locale: 'fr' }
const frCH = { locale: 'fr-sw' }

entrypoints.forEach(entrypoint => {
  const colon = require(entrypoint)

  ava('should do nothing if locale is undefined', t =>
    t.deepEqual(colon(`foo : bar`), `foo : bar`))

  ava('should ignore locale not in DB', t =>
    t.deepEqual(colon(`foo : bar`, american), `foo : bar`))

  ava('should handle fr[-*]', t => {
    t.deepEqual(colon(`foo : bar`, fr), `foo : bar`)
    t.deepEqual(colon(`foo : bar`, frCH), `foo : bar`)
  })
})

@@ -111,16 +111,71 @@
 rc',%0A%5D%0A%0A
+const chars = %7B%0A  'NARROW NO-BREAK SPACE': '%5Cu202F'%0A%7D%0A%0A
 const am
@@ -199,24 +199,24 @@
 : 'en-us' %7D%0A
-
 const fr = %7B
@@ -338,16 +338,100 @@
 point)%0A%0A
+  ava('should do nothing with no param at all', t =%3E%0A    t.deepEqual(colon(), ''))%0A%0A
   ava('s
@@ -711,25 +711,57 @@
 %60, fr), %60foo
-%C2%A0
+$%7Bchars%5B'NARROW NO-BREAK SPACE'%5D%7D
 : bar%60)%0A    
@@ -806,9 +806,41 @@
 %60foo
-%C2%A0
+$%7Bchars%5B'NARROW NO-BREAK SPACE'%5D%7D
 : ba

fix tests