martinpiper / BDD6502

Behaviour Driven Development with 6502 code
27 stars 2 forks source link

Bug in loadLabels - trimming whitespace not assigned #15

Closed markjfisher closed 1 year ago

markjfisher commented 1 year ago

At https://github.com/martinpiper/BDD6502/blob/76de59bd605a4cfd58680676fe6bdf14e59d673d/src/main/java/TestGlue/Glue.java#L1579C25-L1579C25

            splits[0] = splits[0].trim();
            String[] splits2 = splits[1].split(";");
            splits2[0].trim();

The final trim of this block is not being assigned back to splits2[0], as the version 2 lines above it does.

It means assignments of labels like:

FOO = 0x1000
BAR =0x1001

are failing for FOO, but not for BAR due to trying to parse " 0x1000" and the leading space breaking the test for char[0] and char[1] being '0' and 'x'.

Initially couldn't work out it was the space, and things like FOO+0 were working around the bug. Locally I've fixed my labels to never have spaces after =, so it's working, but thought I'd report bug.

martinpiper commented 1 year ago

Noted :)

markjfisher commented 1 year ago

I'd normally just send you a PR, but as I can't compile the project, I'll just report bugs instead.

Really enjoying using this. I've done a bit of BDD in Ruby before for a testing framework we built at my work, but normally I'd be writing straight junit tests.

markjfisher commented 1 year ago

This should be fixed in #17

martinpiper commented 1 year ago

Merged :) Thank you :)