TestCaseWriter login cookie variable name
Hi,
I was just trying to execute EM-generated REST test suites and ran into a compilation error when the login username contains characters that are not permissible as variable names.
As an example: if I have a login username that contains a hyphen (e.g., my-user) the org.evomaster.core.output.auth.CookieWriter (via org.evomaster.core.output.service.ApiTestCaseWriter) will generate the variable name cookies_my-user, which leads to a compilation error.
I assume that this line (https://github.com/EMResearch/EvoMaster/blob/0d6e01be737e8a7a434907eda651d29f1e2ffef3/core/src/main/kotlin/org/evomaster/core/output/auth/CookieWriter.kt#L20) is the place to fix it.
Let me know if you need any more infos.
Christoph
hi,
thx for reporting this bug. indeed, as that name is provided by the user, it could contain invalid characters for a variable.
@chrstphlbr btw, the name is just a label. it does not have to match the actual username. so an easy workaround is to change the label name into my_user while the actual username used in the username field can stay as my-user