diff options
| author | godosa <godosa@godosa.eu> | 2026-10-06 23:39:36 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-06 23:39:36 +0200 |
| commit | 39066900773e7857faf2d02e7ed51b71d219d97d (patch) | |
| tree | ffab8e4ddd971626776c3b1f4ce1da2c186c2187 /scripts/test_thread_instr.py | |
| download | godosa-engine-39066900773e7857faf2d02e7ed51b71d219d97d.tar.gz godosa-engine-39066900773e7857faf2d02e7ed51b71d219d97d.zip | |
godosa-engine: initial public history
Diffstat (limited to 'scripts/test_thread_instr.py')
| -rw-r--r-- | scripts/test_thread_instr.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/test_thread_instr.py b/scripts/test_thread_instr.py new file mode 100644 index 0000000..d23e440 --- /dev/null +++ b/scripts/test_thread_instr.py @@ -0,0 +1,21 @@ +import sys +import unittest +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import thread_instr as ti + + +class ThreadInstrTests(unittest.TestCase): + def test_sums_threads_by_name(self): + text = "\n".join([ + "Game.Desk-100,5000,,instructions:u,100,100.00,,", + "audio-101,300,,instructions:u,100,100.00,,", + "audio-102,200,,instructions:u,100,100.00,,", + "gl0-103,<not counted>,,instructions:u,0,0.00,,", + ]) + self.assertEqual(ti.parse(text), {"Game.Desk": 5000, "audio": 500}) + + +if __name__ == "__main__": + unittest.main() |
