diff options
author | Pavel I. Kryukov <pavel.igorevich.kryukov@gmail.com> | 2022-05-24 01:09:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 15:09:24 -0700 |
commit | 86808b1df8cebda5435fc3d08a1abb86ed73ffd2 (patch) | |
tree | 6332aa572352705a140dd231dd419f048ea338de /test.py | |
parent | 2415a34131979da9a33594212655bfbe72f74a6f (diff) | |
download | riscv-opcodes-86808b1df8cebda5435fc3d08a1abb86ed73ffd2.zip riscv-opcodes-86808b1df8cebda5435fc3d08a1abb86ed73ffd2.tar.gz riscv-opcodes-86808b1df8cebda5435fc3d08a1abb86ed73ffd2.tar.bz2 |
Remove duplicate code (#121)
* Remove duplicate code
* Fix unit test
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -4,13 +4,6 @@ from parse import * import logging import unittest -class ConstantParseTest(unittest.TestCase): - def test_constant(self): - self.assertEqual(parse_constant('10'), 10) - self.assertEqual(parse_constant('0xa'), 10) - self.assertEqual(parse_constant('0xA'), 10) - self.assertEqual(parse_constant('0b1010'), 10) - class EncodingLineTest(unittest.TestCase): def setUp(self): logger = logging.getLogger() @@ -20,7 +13,7 @@ class EncodingLineTest(unittest.TestCase): self.assertRaises(SystemExit, process_enc_line, string, 'rv_i') def test_lui(self): - name, data = process_enc_line('lui rd imm20 6..2=0x0D 1..0=3', 'rv_i') + name, data = process_enc_line('lui rd imm20 6..2=0x0D 1=1 0=1', 'rv_i') self.assertEqual(name, 'lui') self.assertEqual(data['extension'], ['rv_i']) self.assertEqual(data['match'], '0x37') @@ -40,4 +33,4 @@ class EncodingLineTest(unittest.TestCase): self.assertError('jol rd rs1 jimm20 6..2=0x1b 1..0=3') def test_illegal_field(self): - self.assertError('jol rd jimm128 2..0=10') + self.assertError('jol rd jimm128 2..0=3') |