Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Oct 12, 2023
1 parent 872646e commit 88778da
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 42 deletions.
29 changes: 18 additions & 11 deletions src/locale.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* NOTE:
* This test is work in pregoress ...
* We might remove this test file in the future,
* when we will find out that cannot support locale validation
*/

import { expectTypeOf, test } from 'vitest'

import type {
Expand Down Expand Up @@ -321,11 +328,11 @@ test('ParseKeyword', () => {
/**
* Success cases
*/
type t1 = ParseKeyword<['co', 'standard', 'phonetic']>
// type t1 = ParseKeyword<['co', 'standard', 'phonetic']>
expectTypeOf<ParseKeyword<['co', 'standard', 'phonetic']>>().toMatchTypeOf<
['co', 'standard-phonetic', []]
>()
type t2 = ParseKeyword<['co', 'standard']>
// type t2 = ParseKeyword<['co', 'standard']>
expectTypeOf<ParseKeyword<['co', 'standard']>>().toMatchTypeOf<
['co', 'standard', []]
>()
Expand All @@ -334,7 +341,7 @@ test('ParseKeyword', () => {
>()

/** Fail cases */
type t3 = ParseKeyword<['c']>
// type t3 = ParseKeyword<['c']>
expectTypeOf<ParseKeyword<['c']>>().toMatchTypeOf<
[never, ['c']]
>()
Expand All @@ -344,12 +351,12 @@ test('ParseUnicodeExtension', () => {
/**
* Success cases
*/
type t1 = ParseUnicodeExtension<['co', 'standard']>
// type t1 = ParseUnicodeExtension<['co', 'standard']>
expectTypeOf<ParseUnicodeExtension<['co', 'standard']>>()
.toMatchTypeOf<
[{ type: 'u'; keywords: ['co', 'standard']; attributes: [] }, never, []]
>()
type t2 = ParseUnicodeExtension<['foo', 'bar', 'co', 'standard']>
// type t2 = ParseUnicodeExtension<['foo', 'bar', 'co', 'standard']>
expectTypeOf<ParseUnicodeExtension<['foo', 'bar', 'co', 'standard']>>()
.toMatchTypeOf<
[
Expand All @@ -362,7 +369,7 @@ test('ParseUnicodeExtension', () => {
/**
* Fail cases
*/
type t3 = ParseUnicodeExtension<['c']>
// type t3 = ParseUnicodeExtension<['c']>
expectTypeOf<ParseUnicodeExtension<['c']>>().toMatchTypeOf<
[
{ type: 'u'; keywords: []; attributes: [] },
Expand All @@ -376,9 +383,9 @@ test('ParseTransformedExtension', () => {
/**
* Success cases
*/
type t1 = ParseTransformedExtension<
['en', 'Kana', 'US', 'jauer', 'h0', 'hybrid']
>
// type t1 = ParseTransformedExtension<
// ['en', 'Kana', 'US', 'jauer', 'h0', 'hybrid']
// >
expectTypeOf<
ParseTransformedExtension<['en', 'Kana', 'US', 'jauer', 'h0', 'hybrid']>
>()
Expand All @@ -402,7 +409,7 @@ test('ParseTransformedExtension', () => {
/**
* Fail cases
*/
type t2 = ParseTransformedExtension<['en', 'US', 'h0']>
// type t2 = ParseTransformedExtension<['en', 'US', 'h0']>
expectTypeOf<ParseTransformedExtension<['en', 'US', 'h0']>>()
.toMatchTypeOf<
[
Expand All @@ -420,7 +427,7 @@ test('ParseTransformedExtension', () => {
['h0'],
]
>()
type t3 = ParseTransformedExtension<['en']>
// type t3 = ParseTransformedExtension<['en']>
expectTypeOf<ParseTransformedExtension<['en']>>().toMatchTypeOf<
[never, 11, ['en']]
>()
Expand Down
Loading

0 comments on commit 88778da

Please sign in to comment.