Fix parsing VDF files with duplicate keys#5
Merged
andygrunwald merged 1 commit intoandygrunwald:masterfrom Oct 20, 2019
Perplex:master
Merged
Fix parsing VDF files with duplicate keys#5andygrunwald merged 1 commit intoandygrunwald:masterfrom Perplex:master
andygrunwald merged 1 commit intoandygrunwald:masterfrom
Perplex:master
Conversation
| @@ -1,41 +1,39 @@ | |||
| package vdf_test | |||
| package vdf | |||
Owner
There was a problem hiding this comment.
Any particular reason, why the package is renamed?
We use a different package here, to be able to test only functions that are exposed and NOT to test inner behavior.
Contributor
Author
There was a problem hiding this comment.
Im following the Go testing conventions
To write a new test suite, create a file whose name ends _test.go that contains the TestXxx functions as described here. Put the file in the same package as the one being tested. The file will be excluded from regular package builds but will be included when the “go test” command is run. For more detail, run “go help test” and “go help testflag”.
Owner
|
Thank you. Looks good. Just the question about the package rename. |
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An example of a VDF with duplicate keys would be the items_game file from CSGO, it has multiple "items" keys. Here is a copy of it: https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/csgo/scripts/items/items_game.txt
This also includes a fix for the tests to be contained within the package it is testing.