Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 2.08 KB

lab-report-5-week-10.md

File metadata and controls

44 lines (27 loc) · 2.08 KB

Lab Report Week 10

Diff Use

I used the command bash script.sh > results.txt inside each respective directory to save the output of each version of MarkDownParse for each of our 600 or so tests. I then ran diff markdownparseother/markdown-parse-main/results.txt markdown-parse/results.txt in the main directory to compare the results of each version of MarkdownParse for the 600 or so test files. In the below image, I show what a snippet of what the Diff between the two files is, and I manually traversed this to find my test cases.

Image

Test One

Image

Given Implementation

Image

My Implementation

Iamge

Test File

Image

For this one, I'd have to say that my implementation is right because even though there are extra parantheses, we're still following the left bracket, right bracket, left parantheses, right parantheses rule, which means we should be printing a link.

Image

I think the issue with the given implentation is that it looks for the "close paren" or right parantheses too early and trims it beforce it can get added to our toReturn. I'd suggest to just keep it simple by using a substring of left parantheses to the lastIndex of close parantheses, and we'll clean up the substring that is printed manually with some other code.

Test Two

Image

Given Implementation

Image

My Implementation

Iamge

Test File

Image

For this one, I'd say my implementation is right again because an image extension, while using a similar format to the links in markdown, is not a link, so we shouldn't be printing anything.

Image

Image

I put a picture of both codes for reference, but basically you need a separate helper, like checkExtension, method that reads the extensions of the things within the parantheses, and if it contains any of the extensions like .PNG, .JPG, .GIF, etc, it will not be printed.