summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--test/stuff/dirsize_benchmark.py28
-rw-r--r--test/stuff/test1.py70
-rw-r--r--test/stuff/test2.py7
-rw-r--r--test/stuff/test3.py69
-rw-r--r--test/stuff/test4.py36
-rw-r--r--test/stuff/test5.py26
6 files changed, 0 insertions, 236 deletions
diff --git a/test/stuff/dirsize_benchmark.py b/test/stuff/dirsize_benchmark.py
deleted file mode 100644
index 5784ee80..00000000
--- a/test/stuff/dirsize_benchmark.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import os, time
-class Dirsize():
-	def a(path):
-		return len(os.listdir(path))
-
-	def b(path):
-		for _, dirs, files in os.walk(path):
-			return len(files) + len(dirs)
-
-	def c(path):
-		first = next(os.walk(path))
-		return len(first[1]) + len(first[2])
-
-paths = {
-		'/usr/lib': None,
-		'/usr/bin': None,
-		'/home/hut': None
-}
-
-for key in paths.keys():
-	paths[key] = Dirsize.a(key) # assume Dirsize.a() returns a correct result
-	for algo in ['a', 'b', 'c']:
-		t = time.time()
-		for i in range(4):
-			assert Dirsize.__dict__[algo](key) == paths[key]
-		print("algorithm %s: %20s: %f" % (algo, key, time.time() - t))
-
-# a !!
diff --git a/test/stuff/test1.py b/test/stuff/test1.py
deleted file mode 100644
index 97505c41..00000000
--- a/test/stuff/test1.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python3
-# coding=utf-8
-# some tests with curses, threads and unicode
-import os
-import curses
-import time
-import threading
-import locale
-import _thread
-
-lock = _thread.allocate_lock()
-
-locale.setlocale(locale.LC_ALL, 'en_US.utf8')
-
-blocked = False
-stringy = 'るでか'
-stdscr = curses.initscr()
-
-curses.noecho()
-curses.cbreak()
-curses.halfdelay(3)
-stdscr.keypad(1)
-#curses.curs_set(0)
-
-stdscr.addstr(4, 0, stringy)
-stdscr.refresh()
-
-class ThreadTest(threading.Thread):
-	def __init__(self, *a, **b):
-		threading.Thread.__init__(self, *a, **b)
-		self.killed = False
-
-	def run(self):
-		global stdscr
-		global blocked
-		for i in range(1,50):
-			while blocked: time.sleep(0.1)
-			blocked = True
-			stdscr.addstr(1, 0, str(i))
-			stdscr.refresh()
-			blocked = False
-			time.sleep(0.1)
-			if self.killed: raise SystemExit()
-
-	def kill(self):
-		self.killed = True
-
-thr = ThreadTest()
-thr.start()
-
-try:
-	while 1:
-		c = stdscr.getch()
-		if c == ord('q'): raise
-		while blocked: time.sleep(0.1)
-		blocked = True
-		stdscr.addstr(0, 0, str(c))
-		stdscr.refresh()
-		blocked = False
-
-except Exception:
-	thr.kill()
-	raise
-finally:
-	curses.nocbreak()
-	stdscr.keypad(1)
-	curses.echo()
-	curses.endwin()
-#	curses.curs_set(1)
-
diff --git a/test/stuff/test2.py b/test/stuff/test2.py
deleted file mode 100644
index 21c5a5f9..00000000
--- a/test/stuff/test2.py
+++ /dev/null
@@ -1,7 +0,0 @@
-from code import cli
-import signal
-
-with cli.lock:
-	with cli.lock:
-		print("this will be delayed forever")
-	print("hi!")
diff --git a/test/stuff/test3.py b/test/stuff/test3.py
deleted file mode 100644
index 3b1986b7..00000000
--- a/test/stuff/test3.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/python3
-# coding=utf-8
-# some tests with curses, threads and unicode
-import os
-import curses
-import time
-import locale
-
-lock = _thread.allocate_lock()
-
-locale.setlocale(locale.LC_ALL, 'en_US.utf8')
-
-blocked = False
-stringy = 'るでか'
-stdscr = curses.initscr()
-#win1 = curses.newwin(
-
-curses.noecho()
-curses.cbreak()
-curses.halfdelay(3)
-stdscr.keypad(1)
-#curses.curs_set(0)
-
-stdscr.addstr(4, 0, stringy)
-stdscr.refresh()
-
-class ThreadTest(threading.Thread):
-	def __init__(self, *a, **b):
-		threading.Thread.__init__(self, *a, **b)
-		self.killed = False
-
-	def run(self):
-		global stdscr
-		global blocked
-		for i in range(1,50):
-			while blocked: time.sleep(0.1)
-			blocked = True
-			stdscr.addstr(1, 0, str(i))
-			stdscr.refresh()
-			blocked = False
-			time.sleep(0.1)
-			if self.killed: raise SystemExit()
-
-	def kill(self):
-		self.killed = True
-
-thr = ThreadTest()
-thr.start()
-
-try:
-	while 1:
-		c = stdscr.getch()
-		if c == ord('q'): raise
-		while blocked: time.sleep(0.1)
-		blocked = True
-		stdscr.addstr(0, 0, str(c))
-		stdscr.refresh()
-		blocked = False
-
-except Exception:
-	thr.kill()
-	raise
-finally:
-	curses.nocbreak()
-	stdscr.keypad(1)
-	curses.echo()
-	curses.endwin()
-#	curses.curs_set(1)
-
diff --git a/test/stuff/test4.py b/test/stuff/test4.py
deleted file mode 100644
index b2390a03..00000000
--- a/test/stuff/test4.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import random, time
-
-class DelValue():
-	def a(d):
-		return dict((k, v) for k, v in d.items() if v is not 0)
-
-	def b(d):
-		for k, v in d.copy().items():
-			if v == 0: del d[k]
-		return d
-
-	def c(d):
-		for k in tuple(d.keys()):
-			if d[k] == 0: del d[k]
-		return d
-
-	def d(d):
-		for k, v in tuple(d.items()):
-			if v == 0: del d[k]
-		return d
-
-
-basedict = {}
-for i in range(200):
-	basedict[i] = random.randint(0, 1)
-
-expected = DelValue.a(basedict.copy())
-
-for algo in ['a', 'b', 'c', 'd']:
-	copy = basedict.copy()
-	t = time.time()
-	for i in range(100):
-		assert DelValue.__dict__[algo](copy) == expected
-	print("algorithm %s: %f" % (algo, time.time() - t))
-
-# c it is, although b is faster with smaller dictionaries
diff --git a/test/stuff/test5.py b/test/stuff/test5.py
deleted file mode 100644
index 682a716f..00000000
--- a/test/stuff/test5.py
+++ /dev/null
@@ -1,26 +0,0 @@
-class A:
-	def foo(self, x):
-		y = x + 1
-		print(y)
-		return y
-
-	@staticmethod
-	def zar():
-		print("l o l")
-
-class B(A):
-	def bar(self, x):
-		y = self.foo(x) + 3
-		print(y)
-		return y
-
-class C():
-	def foo(self, x):
-		y = x - 1
-		print(y)
-		return y
-
-a = C()
-A.foo(a, 5)
-
-B.zar()
a> 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200