fix replace with tabs and newlines
This commit is contained in:
parent
7c0eb5ca22
commit
0634cf0abc
|
@ -22,13 +22,14 @@ class TestRandomPermutations(OpbTestCase):
|
||||||
def test_random_range_between_three_and_zero(self):
|
def test_random_range_between_three_and_zero(self):
|
||||||
# proc random_range(s0 is max, s2 is shifter, s3 is counter) {
|
# proc random_range(s0 is max, s2 is shifter, s3 is counter) {
|
||||||
# we need to initialize these registers as "parameters". "return value" is in sA (seed)
|
# we need to initialize these registers as "parameters". "return value" is in sA (seed)
|
||||||
|
# the "random 8-bit" value will be shifted until it hits a max.
|
||||||
assert_that = self.load_file("randompermutations.psm4")\
|
assert_that = self.load_file("randompermutations.psm4")\
|
||||||
.replace("call random", "load seed, AF")\
|
.replace("call random", "load seed, 1F")\
|
||||||
.setregs({"s0": 3})\
|
.setregs({"s0": 3})\
|
||||||
.testproc("random_range")\
|
.testproc("random_range")\
|
||||||
.execute()
|
.execute()
|
||||||
|
|
||||||
assert_that.reg("sA").contains(2)
|
assert_that.reg("sA").contains(3)
|
||||||
|
|
||||||
def test_output_configuration_correct_in_output_ports(self):
|
def test_output_configuration_correct_in_output_ports(self):
|
||||||
assert_that = self.load_psm4_assertion()
|
assert_that = self.load_psm4_assertion()
|
||||||
|
|
|
@ -97,8 +97,8 @@ class OpbTestMockable():
|
||||||
for line in data:
|
for line in data:
|
||||||
found = False
|
found = False
|
||||||
for key, value in self.replacers.items():
|
for key, value in self.replacers.items():
|
||||||
if line.upper().replace(" ", "").startswith(key.upper().replace(" ", "")):
|
if line.upper().replace(" ", "").replace("\t", "").startswith(key.upper().replace(" ", "")):
|
||||||
newdata.append(value)
|
newdata.append(value + "\n")
|
||||||
found = True
|
found = True
|
||||||
if found is False:
|
if found is False:
|
||||||
newdata.append(line)
|
newdata.append(line)
|
||||||
|
|
Loading…
Reference in New Issue