Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure INI parser to support bethesda ini files #535

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

Al12rs
Copy link
Contributor

@Al12rs Al12rs commented Aug 8, 2023

@Al12rs Al12rs requested a review from a team August 8, 2023 14:37
@Al12rs Al12rs self-assigned this Aug 8, 2023
@erri120
Copy link
Member

erri120 commented Aug 8, 2023

Should probably add some tests for this.

@Al12rs
Copy link
Contributor Author

Al12rs commented Aug 9, 2023

Should probably add some tests for this.

Something like installing a mod with a "bad" ini file?

Copy link
Member

@erri120 erri120 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have some tests for the config.

@erri120
Copy link
Member

erri120 commented Aug 9, 2023

Should probably add some tests for this.

Something like installing a mod with a "bad" ini file?

You can make the settings object internal and create a test that has various ini files as input and just test if that works:

void Test_IniParser()
{
  const string ini = @"
# this is a comment
foo = bar
";
  //...
}
@Al12rs
Copy link
Contributor Author

Al12rs commented Aug 9, 2023

That assumes I know all the "interesting" cases for inis to fail. What are we checking for exactly?
Is this for the goal of regression testing or more to see if we are covering all the cases we want?

@erri120
Copy link
Member

erri120 commented Aug 9, 2023

That assumes I know all the "interesting" cases for inis to fail. What are we checking for exactly? Is this for the goal of regression testing or more to see if we are covering all the cases we want?

On main, the INI analyzer fails because it can't deal with a comment (#448). You can create a test with an INI file that contains a comment, which should fail on main and succeed on your branch.

@Al12rs
Copy link
Contributor Author

Al12rs commented Aug 9, 2023

Added a test for this

@halgari halgari merged commit 46d6ea7 into main Aug 9, 2023
3 of 5 checks passed
@halgari halgari deleted the crash-on-mods-with-inis branch August 9, 2023 12:17
halgari pushed a commit that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants