text: import {compose} from './compose'
  import {identity} from './identity'
  import {inc} from './inc'
  import {lensPath} from './lensPath'
  import {lensProp} from './lensProp'
  import {over} from './over'
  import {set} from './set'
  import {view} from './view'
  
  const testObj = {
    a: [{b: 1}, {b: 2}],
    d: 3,
  }
  
  test('view', () => {
    expect(view(lensPath('d'), testObj)).toEqual(3)
    expect(view(lensPath('a.0.b'), testObj)).toEqual(1)
    // this is different to ramda, as ramda will return a clone of the input object
    expect(view(lensPath(''), testObj)).toEqual(undefined)
  })
  
  test('set', () => {
    expect(set(lensProp('d'), 0, testObj)).toEqual({
      a: [{b: 1}, {b: 2}],
      d: 0,
    })
    expect(set(lensPath('a.0.b'), 0, testObj)).toEqual({
      a: [{b: 0}, {b: 2}],
      d: 3,
    })
    expect(set(lensPath('a.0.X'), 0, testObj)).toEqual({
      a: [
        {
          b: 1,
          X: 0,
        },
        {b: 2},
      ],
      d: 3,
    })
    expect(set(lensPath([]), 0, testObj)).toEqual(0)
  })
  
  test('over', () => {
    expect(over(lensPath('d'), inc, testObj)).toEqual({
      a: [{b: 1}, {b: 2}],
      d: 4,
    })
    expect(over(lensPath('a.1.b'), inc, testObj)).toEqual({
      a: [{b: 1}, {b: 3}],
      d: 3,
    })
    expect(over(lensProp('X'), identity, testObj)).toEqual({
      a: [{b: 1}, {b: 2}],
      d: 3,
      X: undefined,
    })
    expect(over(lensPath('a.0.X'), identity, testObj)).toEqual({
      a: [
        {
          b: 1,
          X: undefined,
        },
        {b: 2},
      ],
      d: 3,
    })
  })
  
  test('compose', () => {
    const composedLens = compose(lensPath('a'), lensPath('1.b'))
    expect(view(composedLens, testObj)).toEqual(2)
  })
  
  test('set s (get s) === s', () => {
    expect(
      set(lensPath(['d']), view(lensPath(['d']), testObj), testObj)
    ).toEqual(testObj)
    expect(
      set(
        lensPath(['a', 0, 'b']),
        view(lensPath(['a', 0, 'b']), testObj),
        testObj
      )
    ).toEqual(testObj)
  })
  
  test('get (set s v) === v', () => {
    expect(view(lensPath(['d']), set(lensPath(['d']), 0, testObj))).toEqual(0)
    expect(
      view(lensPath(['a', 0, 'b']), set(lensPath(['a', 0, 'b']), 0, testObj))
    ).toEqual(0)
  })
  
  test('get (set(set s v1) v2) === v2', () => {
    const p = ['d']
    const q = ['a', 0, 'b']
    expect(
      view(lensPath(p), set(lensPath(p), 11, set(lensPath(p), 10, testObj)))
    ).toEqual(11)
    expect(
      view(lensPath(q), set(lensPath(q), 11, set(lensPath(q), 10, testObj)))
    ).toEqual(11)
  })
  