[WIP] Finish Tests for Available Functions

Review Request #11830 — Created Oct. 1, 2021 and updated

jordanvandenbruel
DiffX
master
diffx

Only new update is that there is now a test for every function. However,
Go believes we only have ~90% coverage with the tests so I am going to look
and ensure I cover every test case next.

A test file was created on my machine in another directiory (~/Desktop/GoTest) and the module
was imported there. Since it does not make sense for semi-functional code to be pushed to Github,
I setup the local test file to think it's getting its information from
github.com/beanbaginc/diffx/go/godiffx when in reality, it is just checking my local copy. I can
overwrite this whenever code gets published to make sure it still works properly, but that is likely
something that can come towards the end of the project.

The testing file has been used to test out all of the code I have written. There is more detailed
information within each of the commits, but the main idea is that I would import the things I made
and ensure they behave the way I expected them to.

I also have finished writing unit tests for all available functions.

The only piece that still needs to be tested is the Go docs themselves. I have not had enough time
to spin up a local server where I can see what the documentation looks like, but I plan to do that soon
and will update this description once that is finished. I don't expect any issues but this is my first time
creating go docs so we will see.

Summary Author
Create LICENSE and README for project
Jordan
Create basic support files for diffx.
Jordan
Write basic constants for options.go
Jordan
Wrote code for sections.go
Jordan
Update documentation for sections.go
Jordan
Write all custom errors for godiffx.
Jordan
Add documentation and fix line value for DiffXParseError
Jordan
Create text values and write SplitLines
Jordan
Fix Errors and Write StripBom Method.
Jordan
Created test files and wrote init tests for Errors.go
Jordan
Finish tests for errors.go
Jordan
Add testing for sections.go
Jordan
Wrote unit tests for finished functions in text.go
Jordan
Create new error for invalid encoding.
Jordan
Create encode method for text.go
Jordan
Add GetNewlineForType function in text.go
Jordan
Finish manually testing all functions for text.go
Jordan
Write tests for line ending methods.
Jordan
Wrote unit test for encoding function
Jordan
jordanvandenbruel
jordanvandenbruel
jordanvandenbruel
jordanvandenbruel
jordanvandenbruel
jordanvandenbruel
Review request changed

Description:

~  

Further updates from the previous week include work on text.go, the

~   creation of testing files, and some small tweaks to bugs.

~  
  ~

Only new update is that there is now a test for every function. However,

  ~ Go believes we only have ~90% coverage with the tests so I am going to look
  ~ and ensure I cover every test case next.

-  

The 'bugs' in question refer to typos in error messages found while testing

-   and things like no Error() method being used for the errors.

-  
-  

Progress has been made on Text.go, but this part of the code took me a while

-   because it was a lot of learning and experimenting with bytes to better understand
-   how they are treated by different objects. I have a much better understanding of
-   the functionality now, but there are a couple more functions that need to be finished up.

-  
-  

All of the work from the previous week is still here (i.e. work done on options.go,

-   sections.go, and errors.go.

-  
-  

In each of the files, the proper documentation was added via the inline

-   comments. These were also modelled closely after their respective python
-   counterparts, but there are some small differences due to Go's documentation
-   standards (i.e. requiring the comment to begin with the name of what it is
-   talking about).

Commits:

Summary Author
-
Create LICENSE and README for project
Jordan
-
Create basic support files for diffx.
Jordan
-
Write basic constants for options.go
Jordan
-
Wrote code for sections.go
Jordan
-
Update documentation for sections.go
Jordan
-
Write all custom errors for godiffx.
Jordan
-
Add documentation and fix line value for DiffXParseError
Jordan
-
Create text values and write SplitLines
Jordan
-
Fix Errors and Write StripBom Method.
Jordan
-
Created test files and wrote init tests for Errors.go
Jordan
-
Finish tests for errors.go
Jordan
-
Add testing for sections.go
Jordan
-
Wrote unit tests for finished functions in text.go
Jordan
+
Create LICENSE and README for project
Jordan
+
Create basic support files for diffx.
Jordan
+
Write basic constants for options.go
Jordan
+
Wrote code for sections.go
Jordan
+
Update documentation for sections.go
Jordan
+
Write all custom errors for godiffx.
Jordan
+
Add documentation and fix line value for DiffXParseError
Jordan
+
Create text values and write SplitLines
Jordan
+
Fix Errors and Write StripBom Method.
Jordan
+
Created test files and wrote init tests for Errors.go
Jordan
+
Finish tests for errors.go
Jordan
+
Add testing for sections.go
Jordan
+
Wrote unit tests for finished functions in text.go
Jordan
+
Create new error for invalid encoding.
Jordan
+
Create encode method for text.go
Jordan
+
Add GetNewlineForType function in text.go
Jordan
+
Finish manually testing all functions for text.go
Jordan
+
Write tests for line ending methods.
Jordan
+
Wrote unit test for encoding function
Jordan

Diff:

Revision 5 (+2544 -46)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...