Skip to content

Commit 2af7490

Browse files
authored
Added tests 560-1143
1 parent 6c6b0ec commit 2af7490

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// tslint:disable:no-magic-numbers
2+
import { subarraySum } from 'src/main/ts/g0501_0600/s0560_subarray_sum_equals_k/solution'
3+
import { expect, test } from 'vitest'
4+
5+
test('subarraySum', () => {
6+
expect(subarraySum([1, 1, 1], 2)).toEqual(2)
7+
})
8+
9+
test('subarraySum2', () => {
10+
expect(subarraySum([1, 2, 3], 3)).toEqual(2)
11+
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// tslint:disable:no-magic-numbers
2+
import { countSubstrings } from 'src/main/ts/g0601_0700/s0647_palindromic_substrings/solution'
3+
import { expect, test } from 'vitest'
4+
5+
test('countSubstrings', () => {
6+
expect(countSubstrings('abc')).toEqual(3)
7+
})
8+
9+
test('countSubstrings2', () => {
10+
expect(countSubstrings('aaa')).toEqual(6)
11+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// tslint:disable:no-magic-numbers
2+
import { dailyTemperatures } from 'src/main/ts/g0701_0800/s0739_daily_temperatures/solution'
3+
import { expect, test } from 'vitest'
4+
5+
test('dailyTemperatures', () => {
6+
expect(dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73])).toEqual([1, 1, 4, 2, 1, 1, 0, 0])
7+
})
8+
9+
test('dailyTemperatures2', () => {
10+
expect(dailyTemperatures([30, 40, 50, 60])).toEqual([1, 1, 1, 0])
11+
})
12+
13+
test('dailyTemperatures2', () => {
14+
expect(dailyTemperatures([30, 60, 900])).toEqual([1, 1, 0])
15+
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// tslint:disable:no-magic-numbers
2+
import { partitionLabels } from 'src/main/ts/g0701_0800/s0763_partition_labels/solution'
3+
import { expect, test } from 'vitest'
4+
5+
test('partitionLabels', () => {
6+
expect(partitionLabels('ababcbacadefegdehijhklij')).toEqual([9, 7, 8])
7+
})
8+
9+
test('partitionLabels2', () => {
10+
expect(partitionLabels('eccbbbbdec')).toEqual([10])
11+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// tslint:disable:no-magic-numbers
2+
import { longestCommonSubsequence } from 'src/main/ts/g1101_1200/s1143_longest_common_subsequence/solution'
3+
import { expect, test } from 'vitest'
4+
5+
test('longestCommonSubsequence', () => {
6+
expect(longestCommonSubsequence('abcde', 'ace')).toEqual(3)
7+
})
8+
9+
test('longestCommonSubsequence2', () => {
10+
expect(longestCommonSubsequence('abc', 'abc')).toEqual(3)
11+
})
12+
13+
test('longestCommonSubsequence3', () => {
14+
expect(longestCommonSubsequence('abc', 'def')).toEqual(0)
15+
})

0 commit comments

Comments
 (0)