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

Improve stdin character generation #34

Open
Aaron1011 opened this issue Jan 29, 2019 · 7 comments
Open

Improve stdin character generation #34

Aaron1011 opened this issue Jan 29, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@Aaron1011
Copy link
Collaborator

Currently, StdinCharGenerator can only generate characters within a specified range. It would be useful to be able to specify additional characters outside of that range (e.g. \n), to allow properly solving tests/wyvern

@Tiecoon
Copy link
Owner

Tiecoon commented Jan 29, 2019

Currently I believe the min and Max can be set to cover the entire ascii range of 0-255. The issue with the new line I believe is that we forcefully close stdin to prevent waiting on input. Also the test case I believe doesn't check the last character anyways so it wouldn't show up as new line unless we don't close stdin like it does now.

@Tiecoon
Copy link
Owner

Tiecoon commented Jan 29, 2019

The default constructor is set to the ascii range of 0x20-0x75. Which does include \n it's just a byproduct of the way it's being run that the binary isn't effected by the last character.

@Aaron1011
Copy link
Collaborator Author

Isn't 0x0a the code for \n?

@Tiecoon
Copy link
Owner

Tiecoon commented Jan 29, 2019

Ah yeah, the stdin generator constructor currently had fields to set a min and max. You could try setting it lower on the test case but I believe it won't make a difference unless we risk a program hanging on stdin.

@Tiecoon
Copy link
Owner

Tiecoon commented Jan 29, 2019

It might be nice to be able to support multiple separate ranges in this case I guess

@Tiecoon
Copy link
Owner

Tiecoon commented Jan 29, 2019

Yeah ok I see what you mean, I think I misread the initial issue. I don't think it will fix the test case output however. Just a heads up null bytes may effect strlen and cause issues.

@twizmwazin
Copy link
Collaborator

twizmwazin commented Jan 30, 2019

The range implementation was to prevent null bytes causing short strings to be larger outliers than correct results. This could be replaced with a alternative constructor taking a Vec<u8> of all acceptable values.

@Tiecoon Tiecoon added the enhancement New feature or request label Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants