-
Notifications
You must be signed in to change notification settings - Fork 2
/
tests.py
60 lines (45 loc) · 1.15 KB
/
tests.py
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
57
58
59
60
import secrets
import random
import time
from posw import *
from util import *
def random_tests():
print("Selecting from (0, 1)^1")
print(opening_challenge(t=10))
print(sha256H(1, 10))
print(sha256H(11, 0))
print(sha256H(100, 1))
print(sha256H(11, 100))
g = nx.DiGraph()
g.add_node(1)
g.add_nodes_from([2, 3])
g.add_edge(1, 2)
print(g.nodes)
print(BinaryString(3, 3))
print(BinaryString(7, 31))
print(BinaryString(1, 1))
print(BinaryString(1, 0))
def graph_tests():
chi = statement()
G = compute_posw(chi)
print(G.nodes)
def class_tests():
test1 = BinaryString(5, 10)
test2 = BinaryString(1, 1)
test3 = BinaryString(0, 0)
test4 = BinaryString(10, 231)
print(test1.get_bit_list())
print(test2.get_bit_list())
print(test3.get_bit_list())
print(test4.get_bit_list())
def test_path_siblings():
for x in path_siblings(BinaryString(5, 10)):
print(x)
for x in path_siblings(BinaryString(4, 10)):
print(x)
if __name__ == '__main__':
print("Starting tests.")
random_tests()
graph_tests()
class_tests()
test_path_siblings()