Skip to content

Commit

Permalink
test: add more test cases to 02822-split (type-challenges#29842)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaowoxiaobala authored Sep 1, 2023
1 parent 8f9b1c8 commit aa5bd12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions questions/02822-hard-split/test-cases.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import type { Equal, Expect } from '@type-challenges/utils'

type cases = [
Expect<Equal<Split<'Hi! How are you?'>, ['Hi! How are you?']>>,
Expect<Equal<Split<'Hi! How are you?', 'z'>, ['Hi! How are you?']>>,
Expect<Equal<Split<'Hi! How are you?', ' '>, ['Hi!', 'How', 'are', 'you?']>>,
Expect<Equal<Split<'Hi! How are you?', ''>, ['H', 'i', '!', ' ', 'H', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', '?']>>,
Expect<Equal<Split<'', ''>, []>>,
Expect<Equal<Split<'The sine in cosine', 'in'>, ['The s', 'e ', ' cos', 'e']>>,
Expect<Equal<Split<'Never say never, forever and ever.', 'ver'>, ['Ne', ' say ne', ', fore', ' and e', '.']>>,
Expect<Equal<Split<'', 'z'>, ['']>>,
Expect<Equal<Split<''>, ['']>>,
Expect<Equal<Split<string, 'whatever'>, string[]>>,
]

0 comments on commit aa5bd12

Please sign in to comment.