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

Normalize additional identifiers #11

Open
mikedamay opened this issue Aug 26, 2020 · 1 comment
Open

Normalize additional identifiers #11

mikedamay opened this issue Aug 26, 2020 · 1 comment

Comments

@mikedamay
Copy link
Contributor

mikedamay commented Aug 26, 2020

structs and property names do not appear to be normalized resulting in the following kind of representation:

public struct Fake
{
    private int PLACEHOLDER_1;
    public int PLACEHOLDER_2()
    {
        return PLACEHOLDER_1;
    }

    public int P
    {
        get => PLACEHOLDER_1;
    }

    public int P2
    {
        get => PLACEHOLDER_1;
        set
        {
            PLACEHOLDER_1 = value;
        }
    }
    Point PLACEHOLDER_4 = new Point(X = 0, Y = 0};
}

public class PLACEHOLDER_1
{
    void PLACEHOLDER_2()
    {
        int LocalInt(int PLACEHOLDER_3) => PLACEHOLDER_3;
        var PLACEHOLDER_4 = new Dictionary<int, Func<string, string>>{{LocalInt(5), PLACEHOLDER_5 => PLACEHOLDER_5}, };
    }
}

Fake, P, P2, X, Y, LocalInt should all be normalized. This will break some tests.

@mikedamay mikedamay changed the title Prevent new line being inserted into representations uhiu Aug 26, 2020
@mikedamay mikedamay reopened this Aug 27, 2020
@mikedamay mikedamay changed the title uhiu Normalize additional identifiers Aug 27, 2020
@ErikSchierboom
Copy link
Member

This will break some tests.

I've had this situation before, which is why I've added a nifty little flag you can pass to the test.ps1 script named UpdateExpected that will update all the expected values.

The steps are:

  1. Update the code to also normalize the other identifiers
  2. Run test.ps1 -UpdateExpected

Disclaimer: only run this when you are confident the code works, as otherwise the expected values would be changed to something that is not correct :)

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

No branches or pull requests

2 participants