Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/test_jsonld.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,3 +931,19 @@ def test_empty_context(self):
input = {'http://schema.org/codeRepository': {'@id': 'http:'}}
compacted = jsonld.compact(input, {})
assert compacted == input

# Issue 61
def test_compact_arrays(self):
"""
Compacting with an empty context should return the input unchanged.
"""
input = {
"key1": "abc",
"key2": ["abc", "def"]
}
expected = {
"key1": "abc",
"key2": ["abc", "def"]
}
compacted = jsonld.compact(input, {}, {"compactArrays": True})
assert compacted == expected
Loading