Sha256: 9e660ac6ab15cf01da2c71644c05979b318663566387680ff84ba3451d5edd47

Contents?: true

Size: 1.58 KB

Versions: 71

Compression:

Stored size: 1.58 KB

Contents

import Pangram from './pangram'

describe('Pangram()', () => {

  it('empty sentence', () => {
    const pangram = new Pangram('')
    expect(pangram.isPangram()).toBe(false)
  })

  it('pangram with only lower case', () => {
    const pangram = new Pangram("the quick brown fox jumps over the lazy dog")
    expect(pangram.isPangram()).toBe(true)
  })

  it("missing character 'x'", () => {
    const pangram = new Pangram("a quick movement of the enemy will jeopardize five gunboats")
    expect(pangram.isPangram()).toBe(false)
  })

  it("another missing character 'x'", () => {
    const pangram = new Pangram("the quick brown fish jumps over the lazy dog")
    expect(pangram.isPangram()).toBe(false)
  })

  it("pangram with underscores", () => {
    const pangram = new Pangram("the_quick_brown_fox_jumps_over_the_lazy_dog")
    expect(pangram.isPangram()).toBe(true)
  })

  it("pangram with numbers", () => {
    const pangram = new Pangram("the 1 quick brown fox jumps over the 2 lazy dogs")
    expect(pangram.isPangram()).toBe(true)
  })

  it('missing letters replaced by numbers', () => {
    const pangram = new Pangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")
    expect(pangram.isPangram()).toBe(false)
  })

  it('pangram with mixed case and punctuation', () => {
    const pangram = new Pangram("\"Five quacking Zephyrs jolt my wax bed.\"")
    expect(pangram.isPangram()).toBe(true)
  })

  it('pangram with non-ascii characters', () => {
    const pangram = new Pangram("Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.")
    expect(pangram.isPangram()).toBe(true)
  })

})

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
trackler-2.0.8.52 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.51 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.50 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.49 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.48 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.47 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.46 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.45 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.44 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.43 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.42 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.41 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.40 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.39 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.38 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.37 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.36 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.35 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.34 tracks/typescript/exercises/pangram/pangram.test.ts
trackler-2.0.8.33 tracks/typescript/exercises/pangram/pangram.test.ts