js-practice/test/string/contains-duplicate.test.js

8 lines
289 B
JavaScript
Raw Normal View History

2019-03-10 16:43:04 +08:00
import { containsDuplicate } from '../../src/string/contains-duplicate'
test('存在重复元素', () => {
expect(containsDuplicate([1, 2, 3, 1])).toBe(true)
expect(containsDuplicate([1, 2, 3, 4])).toBe(false)
expect(containsDuplicate([1, 1, 1, 3, 3, 4, 3, 2, 4, 2])).toBe(true)
})