-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchallenge22.test.js
56 lines (43 loc) · 1.11 KB
/
challenge22.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { test, describe, expect, expectTypeOf } from 'vitest'
import { compile } from './challenge22'
describe('Programming language', () => {
test('Test 1', () => {
expectTypeOf(compile).returns.toEqualTypeOf()
})
test('Test 2', () => {
expect(compile('++*-')).toEqual(3)
})
test('Test 3', () => {
expect(compile('++¿+?')).toEqual(3)
})
test('Test 4', () => {
expect(compile('-+¿+?')).toEqual(0)
})
test('Test 5', () => {
expect(compile('++*¿-?')).toEqual(3)
})
test('Test 5', () => {
expect(compile('++%++<')).toEqual(6)
})
test('Test 6', () => {
expect(compile('++%++<')).toEqual(6)
})
test('Test 7', () => {
expect(compile('++%++<++¿*?')).toEqual(16)
})
test('Test 8', () => {
expect(compile('++¿+?¿+?¿+?')).toEqual(5)
})
test('Test 9', () => {
expect(compile('--¿+++?')).toEqual(-2)
})
test('Test 10', () => {
expect(compile('--¿+++?+++¿--?')).toEqual(-1)
})
test('Test 11', () => {
expect(compile('<%+¿++%++<?')).toEqual(7)
})
test('Test 12', () => {
expect(compile('<<<<<<+<<<<<+%')).toEqual(2)
})
})