Skip to content

Commit

Permalink
Arrays are now correctly not enclosed in an object/tuborg clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
peheje committed Jun 14, 2017
1 parent b393089 commit 5ae5667
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ build
!default.perspectivev3
*.xcuserdata
*.xcuserstate
*.xcbkptlist
18 changes: 16 additions & 2 deletions JsonSerializerSwiftTests/JsonSerializerSwiftTests.swift
Expand Up @@ -651,7 +651,7 @@ class JSONSerializerTests: XCTestCase {
print(json)

//Assert
let expected = "{[1, 2, 3]}"
let expected = "[1, 2, 3]"
stringCompareHelper(json, expected)
}

Expand All @@ -665,7 +665,21 @@ class JSONSerializerTests: XCTestCase {
print(json)

//Assert
let expected = "{[2.2, 1.5, 5.6]}"
let expected = "[2.2, 1.5, 5.6]"
stringCompareHelper(json, expected)
}

func test_stringArray_noIndex() {

//Arrange
let m = ["hello", "how", "are"]

//Act
let json = JSONSerializer.toJson(m, prettify: false)
print(json)

//Assert
let expected = "[\"hello\", \"how\", \"are\"]"
stringCompareHelper(json, expected)
}

Expand Down

0 comments on commit 5ae5667

Please sign in to comment.