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

Fix invalid C# code in data set #15

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mrward
Copy link

@mrward mrward commented Oct 30, 2023

Issue: #13

Description of changes:

  • Fix invalid code in HumanEval_csharp/12
    Test code was using 'var expected1 = null' which is invalid in C#.
    Change this to be 'string? expected1 = null' and also change the
    return type of the Longest method to be string? instead of object.

  • Fix comment in HumanEval_csharp/47
    The comment for the method shows the wrong value 15.0 being returned
    from the Median method for the values -10, 4, 6, 1000, 10, 20. The
    test checking the return value uses the correct value 8.0. Update
    the comment to use the correct value since this seems to affect the
    result generated.

  • Fix invalid code in HumanEval_csharp/90
    Test code was using 'var expected3 = null' which is invalid C#.
    Change the code to use int? instead. Also change the NextSmallest
    method to return int? instead of object.

  • Fix invalid code in HumanEval_csharp/114
    A test was trying to store -9999999999999999 in an int. Use long
    instead of int so this value can be stored.

  • Fix invalid code in HumanEval_csharp/128
    Test code was using 'var expected4 = null' which is invalid C#.
    Use int? instead and also change the ProdSigns method to return an
    int? instead of an object.

  • Fix invalid code in HumanEval_csharp/137
    A test was using 'var expected8 = null' which is invalid C#. Use
    int? instead of var and also change the CompareOne method to return
    object? instead of object since it supports returning null.

  • Fix invalid code in HumanEval_csharp/160
    The DoAlgebra method was using 'operator' as a parameter name
    which is invalid in C#. Use '@operator' instead.

  • Fix invalid code in HumanEval_csharp/162
    A test was using 'var expected2 = null' which is invalid C#. Use
    string? instead of var. Also change the StringToMd5 method to return
    a string? instead of an object.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The comment for the method shows the wrong value 15.0 being returned
from the Median method for the values -10, 4, 6, 1000, 10, 20. The
test checking the return value uses the correct value 8.0. Update
the comment to use the correct value since this seems to affect the
result generated.
Test code was using 'var expected1 = null' which is invalid in C#.
Change this to be 'string? expected1 = null' and also change the
return type of the Longest method to be string? instead of object.
Test code was using 'var expected3 = null' which is invalid C#.
Change the code to use int? instead. Also change the NextSmallest
method to return int? instead of object.
A test was trying to store -9999999999999999 in an int. Use long
instead of int so this value can be stored.
Test code was using 'var expected4 = null' which is invalid C#.
Use int? instead and also change the ProdSigns method to return an
int? instead of an object.
A test was using 'var expected8 = null' which is invalid C#. Use
int? instead of var and also change the CompareOne method to return
object? instead of object since it supports returning null.
The DoAlgebra method was using 'operator' as a parameter name
which is invalid in C#. Use '@operator' instead.
A test was using 'var expected2 = null' which is invalid C#. Use
string? instead of var. Also change the StringToMd5 method to return
a string? instead of an object.
@benathi
Copy link
Contributor

benathi commented Nov 2, 2023

Thank you for your PR. We really appreciate it.

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