-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathm_decoded_string_test.py
More file actions
39 lines (26 loc) · 972 Bytes
/
Copy pathm_decoded_string_test.py
File metadata and controls
39 lines (26 loc) · 972 Bytes
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
from stack.m_decoded_string import DecodeString
class TestDecodeString:
def test_lc_data_1(self):
ds = DecodeString()
ans = ds.valueAtIndex_bf("leet2code3", 15)
assert ans == "e"
ans = ds.valueAtIndex_opm("leet2code3", 15)
assert ans == "e"
ans = ds.valueAtIndex_opm_2("leet2code3", 15)
assert ans == "e"
def test_lc_data_2(self):
ds = DecodeString()
ans = ds.valueAtIndex_bf("ha22", 5)
assert ans == "h"
def test_lc_data_3(self):
ds = DecodeString()
ans = ds.valueAtIndex_bf("a2345678999999999999999", 1)
assert ans == "a"
ans = ds.valueAtIndex_opm("a2345678999999999999999", 18)
assert ans == "a"
ans = ds.valueAtIndex_opm_2("a2345678999999999999999", 18)
assert ans == "a"
def test_lc_data_4(self):
ds = DecodeString()
ans = ds.valueAtIndex_bf("test3code4", 15)
assert ans == "d"