Skip to content

Commit

Permalink
Test is now passing (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaber authored Jan 24, 2022
1 parent 456b20f commit d4d97a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public TokenFilter includeElement(int index) {
protected boolean _includeScalar() { return false; }
}

static class NoArraysFilter extends TokenFilter
{
@Override
public TokenFilter filterStartArray() {
return null;
}
}

static class NoObjectsFilter extends TokenFilter
{
@Override
Expand Down Expand Up @@ -412,6 +420,20 @@ public void testNoMatchFiltering6() throws Exception
assertEquals(0, p.getMatchCount());
}

public void testValueOmitsFieldName1() throws Exception
{
String jsonString = aposToQuotes("{'a':123,'array':[1,2]}");
JsonParser p0 = JSON_F.createParser(jsonString);
FilteringParserDelegate p = new FilteringParserDelegate(p0,
new NoArraysFilter(),
Inclusion.INCLUDE_NON_NULL,
true // multipleMatches
);
String result = readAndWrite(JSON_F, p);
assertEquals(aposToQuotes("{'a':123}"), result);
assertEquals(1, p.getMatchCount());
}

public void testValueOmitsFieldName2() throws Exception
{
String jsonString = aposToQuotes("['a',{'value0':3,'b':{'value':4}},123]");
Expand Down

This file was deleted.

0 comments on commit d4d97a6

Please sign in to comment.