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

Add bad manifest filenames tests #845

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Conversation

xexyl
Copy link
Contributor

@xexyl xexyl commented Nov 7, 2023

Each forbidden filename in the manifest now has a separate file to check
it including prog.alt. The -34.json file was also updated to have
prog.alt as an extra filename though it might be better to also check
this for other files too if this is not done (been too long and too many
other changes in the other repo to recall if this is done or not).

That means that under test_ioccc/test_JSON/info.json/bad individual
files that have an extra file with the names of:

  • README.md
  • index.html
  • inventory.html
  • prog
  • prog.alt
  • prog.orig
  • prog.orig.c

have been added. Unless other files have to be added later to the list
of disallowed filenames or there needs to be a more specific check in
mkiocccentry for filenames of the required files this should complete
the disallowed and required filenames checks.

Add another forbidden file name in submissions: prog.alt (prog.alt.c is
allowed).

Modularise the checks for invalid filenames in entries. For instance in
check_extra_file() there's no need to check each extra filename and then give
the same error message changing the macro of the filename that's disallowed when
we can just print the string being tested against. The only difference is that
there's one if (with multiple checks) and instead of duplicating the same error
message we just print it once with the string being tested against. Note that
there are two sets of checks: one for extra files being required filenames and
another for disallowed filenames.

Make sure to use the macros for the filenames, not the literal strings (e.g. use
PROG_FILENAME not "prog").

Check filenames in alphabetical order (I think :-) .. very tired so maybe missed
one or two).

Note that the function check_extra_file() CANNOT be used in every case so it's
not used except in chkentry!
Each forbidden filename in the manifest now has a separate file to check
it including prog.alt. The -34.json file was also updated to have
prog.alt as an extra filename though it might be better to also check
this for other files too if this is not done (been too long and too many
other changes in the other repo to recall if this is done or not).

That means that under test_ioccc/test_JSON/info.json/bad individual
files that have an extra file with the names of:

- README.md
- index.html
- inventory.html
- prog
- prog.alt
- prog.orig
- prog.orig.c

have been added. Unless other files have to be added later to the list
of disallowed filenames or there needs to be a more specific check in
mkiocccentry for filenames of the required files this should complete
the disallowed and required filenames checks.
@lcn2 lcn2 merged commit 3d78f65 into ioccc-src:master Nov 7, 2023
2 checks passed
@lcn2
Copy link
Contributor

lcn2 commented Nov 7, 2023

Thanks @xexyl

Going back to sleep 🛌 🥱 😴

@xexyl
Copy link
Contributor Author

xexyl commented Nov 7, 2023

Thanks @xexyl

Going back to sleep 🛌 🥱 😴

Hope you got some sleep!

@xexyl xexyl deleted the bad-manifest-files branch November 7, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants