startup-os icon indicating copy to clipboard operation
startup-os copied to clipboard

MessageDifferencer ignoreFields doesn't work for RepeatedFields.

Open sumitbh250 opened this issue 6 years ago • 4 comments

    message B {
        message C {
            optional string details = 1;
            optional string time = 2;
        }
        repeated C c = 1;
    }
    repeated B b = 1;
}```

If message is of the above form and if we add details to ignoreField MessageDifferencer.compare doesn't work if number of RepeatedFields is different.

sumitbh250 avatar Oct 23 '19 09:10 sumitbh250

We just forked the code in truth. Can you put this issue on the truth repo? https://github.com/google/truth

oferb avatar Oct 23 '19 09:10 oferb

@oferb Can you point me to this file in truth repo? It seems it's not present there.

sumitbh250 avatar Oct 23 '19 09:10 sumitbh250

Indeed, looks like it was deleted: https://github.com/google/truth/commit/b00942127329c8ff8f9587a391c0b610f764efc1

oferb avatar Oct 23 '19 09:10 oferb

Perhaps this is the new differencer? https://github.com/google/truth/blob/master/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/ProtoTruthMessageDifferencer.java

oferb avatar Oct 23 '19 09:10 oferb