Ancestors

Written by The Last Psion | Alex on 2025-01-24 at 13:02

Finally - FINALLY - unit tests in #FreePascal make sense. As usual, it was a few tiny details that I couldn't quite grasp. Someone (@jbmorley) very kindly took the time to walk me though, and now I'm all set to test and refactor #CTRAN!

FYI: I'm using FPTest, which has a much nicer CLI output that FPCUnit.

=> More informations about this toot | More toots from thelastpsion@oldbytes.space

Toot

Written by The Last Psion | Alex on 2025-01-24 at 13:28

Next thing I need to look up - inheritance. Specifically, creating a wrapper class to test private methods in a parent class.

=> More informations about this toot | More toots from thelastpsion@oldbytes.space

Descendants

Written by The Last Psion | Alex on 2025-01-25 at 10:03

Well, it was surprisingly easy. Here, I'm re-declaring a strict protected method as private:

TPsionOOParserWrap = class(TPsionOOParser)

    private

        procedure _AddToken(toktype: TTokenType; tokliteral: String);

end;

{ snip }

procedure TPsionOOParserWrap._AddToken(toktype: TTokenType; tokliteral: String);

begin

Inherited;

end;

If someone with more knowledge of #ObjectPascal than me thinks that this is unnecessary, or there's a better way to do it, then please let me know!

[#]Pascal #FreePascal

=> More informations about this toot | More toots from thelastpsion@oldbytes.space

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113883564674288441
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
270.33251 milliseconds
Gemini-to-HTML Time
1.199544 milliseconds

This content has been proxied by September (3851b).