From f1180e5c02fc6b9a4381ca7edae1aaae778c5e41 Mon Sep 17 00:00:00 2001 From: Alistair Grant Date: Wed, 6 Nov 2024 16:12:16 +0100 Subject: [PATCH] [feenkcom/gtoolkit#4072] Support strict symbol comparisons --- .../class/knownEncodingIdentifiers.st | 2 +- .../instance/identifier.st | 2 +- .../class/knownEncodingIdentifiers.st | 2 +- .../ZnNullEncoder.class/instance/identifier.st | 2 +- .../class/knownEncodingIdentifiers.st | 2 +- .../ZnUTF8Encoder.class/instance/identifier.st | 2 +- .../instance/testKnownEncodingIdentifiers.st | 2 +- .../instance/handlePostRequest..st | 4 ++-- .../instance/handleRequest..st | 2 +- .../instance/testUpload.st | 4 ++-- .../properties.json | 2 +- .../instance/handleRequest..st | 3 ++- .../instance/handleRequest..st | 2 +- .../instance/formTest2..st | 2 +- .../instance/formTest3..st | 2 +- .../instance/{timeStamp.st => timestamp.st} | 0 .../ZnRequestLine.class/instance/method..st | 7 ++++--- .../ZnRequestLine.class/instance/method.st | 2 ++ .../ZnRequestLine.class/instance/readFrom..st | 2 +- .../ZnUtils.class/class/parseHttpDate..st | 2 +- .../monticello.meta/categories.st | 9 ++++++++- .../instance/testCreate.st | 4 ++-- .../instance/testQuery.st | 8 ++++---- .../instance/testUpdate.st | 8 ++++---- .../monticello.meta/categories.st | 4 ++-- .../instance/isSchemeNotUsingDoubleSlash..st | 2 +- .../ZnUrlTest.class/instance/testQueryAccessing.st | 2 +- .../instance/testQueryManipulation.st | 2 +- .../ZnClientTest.class/instance/testGetGeoIP.st | 2 +- .../ZnClientTest.class/instance/testOptions.st | 4 ++-- .../ZnClientTest.class/instance/testPatch.st | 4 ++-- .../instance/testReadingMultiline.st | 4 ++-- .../instance/testWriting.st | 2 +- .../instance/testMergedFields.st | 14 +++++++------- .../ZnServerTest.class/instance/testFormTest2.st | 2 +- .../ZnServerTest.class/instance/testLogging.st | 2 +- 36 files changed, 66 insertions(+), 55 deletions(-) rename repository/Zinc-HTTP.package/ZnLogEvent.class/instance/{timeStamp.st => timestamp.st} (100%) diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/class/knownEncodingIdentifiers.st b/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/class/knownEncodingIdentifiers.st index b055c710..26056b49 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/class/knownEncodingIdentifiers.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/class/knownEncodingIdentifiers.st @@ -1,3 +1,3 @@ accessing knownEncodingIdentifiers - ^ #( utf8lossy ) \ No newline at end of file + ^ #( 'utf8lossy' ) \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/instance/identifier.st b/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/instance/identifier.st index d764db0e..d0d045a7 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/instance/identifier.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnLossyUTF8Encoder.class/instance/identifier.st @@ -1,3 +1,3 @@ accessing identifier - ^ #utf8lossy \ No newline at end of file + ^ 'utf8lossy' \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/class/knownEncodingIdentifiers.st b/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/class/knownEncodingIdentifiers.st index ee503ea6..a6efbb92 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/class/knownEncodingIdentifiers.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/class/knownEncodingIdentifiers.st @@ -1,3 +1,3 @@ accessing knownEncodingIdentifiers - ^ #( null ) \ No newline at end of file + ^ #( 'null' ) \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/instance/identifier.st b/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/instance/identifier.st index d7342d45..79792501 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/instance/identifier.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnNullEncoder.class/instance/identifier.st @@ -1,3 +1,3 @@ accessing identifier - ^ #null \ No newline at end of file + ^ 'null' \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/class/knownEncodingIdentifiers.st b/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/class/knownEncodingIdentifiers.st index 795a27e2..2d99b572 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/class/knownEncodingIdentifiers.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/class/knownEncodingIdentifiers.st @@ -1,3 +1,3 @@ accessing knownEncodingIdentifiers - ^ #( utf8 ) \ No newline at end of file + ^ #( 'utf8' ) \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/instance/identifier.st b/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/instance/identifier.st index fbf28ccb..ac7da7b2 100644 --- a/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/instance/identifier.st +++ b/repository/Zinc-Character-Encoding-Core.package/ZnUTF8Encoder.class/instance/identifier.st @@ -1,3 +1,3 @@ accessing identifier - ^ #utf8 \ No newline at end of file + ^ 'utf8' \ No newline at end of file diff --git a/repository/Zinc-Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testKnownEncodingIdentifiers.st b/repository/Zinc-Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testKnownEncodingIdentifiers.st index c0b945e9..a551e87a 100644 --- a/repository/Zinc-Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testKnownEncodingIdentifiers.st +++ b/repository/Zinc-Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testKnownEncodingIdentifiers.st @@ -2,7 +2,7 @@ testing testKnownEncodingIdentifiers | all minimal asciiString notSelfIdentifying| all := ZnCharacterEncoder knownEncodingIdentifiers asSet. - minimal := #(utf8 latin1 null ascii iso88591) asSet. + minimal := #('utf8' 'latin1' 'null' 'ascii' 'iso88591') asSet. "make sure at least a minimal set is present" self assert: (all intersection: minimal) equals: minimal. asciiString := String withAll: ($a to: $z) , ($A to: $Z) , ($0 to: $9). diff --git a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handlePostRequest..st b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handlePostRequest..st index 1bb3cb6a..25384fb3 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handlePostRequest..st +++ b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handlePostRequest..st @@ -8,11 +8,11 @@ handlePostRequest: request (request hasEntity and: [ request contentType matches: ZnMimeType multiPartFormData ]) ifFalse: badRequest. part := request entity - partNamed: #file + partNamed: 'file' ifNone: badRequest. newImage := part entity. (newImage isNotNil and: [ newImage contentType matches: 'image/*' asZnMimeType ]) ifFalse: badRequest. [ self formForImageEntity: newImage ] on: Error do: badRequest. image := newImage. - ^ ZnResponse redirect: #image \ No newline at end of file + ^ ZnResponse redirect: 'image' \ No newline at end of file diff --git a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handleRequest..st b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handleRequest..st index e1a59ae8..3b3b1fd3 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handleRequest..st +++ b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegate.class/instance/handleRequest..st @@ -2,7 +2,7 @@ public handleRequest: request "Dispatch between GET and POST on /image" - request uri path = #image + request uri path = 'image' ifTrue: [ request method = #GET ifTrue: [ diff --git a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/instance/testUpload.st b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/instance/testUpload.st index 984d502c..aece4d0c 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/instance/testUpload.st +++ b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/instance/testUpload.st @@ -4,8 +4,8 @@ testUpload | image client | image := self image. client := ZnClient new. - client url: server localUrl; addPath: #image. - client addPart: (ZnMimePart fieldName: #file entity: image). + client url: server localUrl; addPath: 'image'. + client addPart: (ZnMimePart fieldName: 'file' entity: image). client post. self assert: client isSuccess. client resetEntity; queryAt: #raw put: #true. diff --git a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/properties.json b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/properties.json index 3ed1c551..43e6a74b 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/properties.json +++ b/repository/Zinc-HTTP-Examples.package/ZnImageExampleDelegateTest.class/properties.json @@ -1,5 +1,5 @@ { - "commentStamp" : "SvenVanCaekenberghe 12/8/2019 14:05", + "commentStamp" : "", "super" : "TestCase", "category" : "Zinc-HTTP-Examples", "classinstvars" : [ ], diff --git a/repository/Zinc-HTTP-Examples.package/ZnReadEvalPrintDelegate.class/instance/handleRequest..st b/repository/Zinc-HTTP-Examples.package/ZnReadEvalPrintDelegate.class/instance/handleRequest..st index 000a7b37..ae17e424 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnReadEvalPrintDelegate.class/instance/handleRequest..st +++ b/repository/Zinc-HTTP-Examples.package/ZnReadEvalPrintDelegate.class/instance/handleRequest..st @@ -1,6 +1,7 @@ public handleRequest: request - request uri firstPathSegment = #repl + + request uri firstPathSegment = 'repl' ifTrue: [ request method = #GET ifTrue: [ diff --git a/repository/Zinc-HTTP-Examples.package/ZnStaticFileDecoratorDelegate.class/instance/handleRequest..st b/repository/Zinc-HTTP-Examples.package/ZnStaticFileDecoratorDelegate.class/instance/handleRequest..st index cfdbab8e..c582a37d 100644 --- a/repository/Zinc-HTTP-Examples.package/ZnStaticFileDecoratorDelegate.class/instance/handleRequest..st +++ b/repository/Zinc-HTTP-Examples.package/ZnStaticFileDecoratorDelegate.class/instance/handleRequest..st @@ -3,7 +3,7 @@ handleRequest: znRequest "try to resolve the uri path into a file for response. If not found dispatch the request to the given delegate" | response | - (znRequest method = 'GET') + (znRequest method = #GET) ifTrue: [ response := (staticDelegate handleRequest: znRequest). response isSuccess ifTrue: [ diff --git a/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest2..st b/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest2..st index 47959ee5..f2c8c49c 100644 --- a/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest2..st +++ b/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest2..st @@ -3,7 +3,7 @@ formTest2: request | input page | input := 'input'. (request hasEntity and: [ request contentType matches: ZnMimeType applicationFormUrlEncoded ]) - ifTrue: [ input := request entity at: #input ifAbsent: [ 'input' ] ]. + ifTrue: [ input := request entity at: 'input' ifAbsent: [ 'input' ] ]. page := ZnHtmlOutputStream streamContents: [ :html | html page: 'Form Test 2' do: [ html diff --git a/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest3..st b/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest3..st index 55e9f26d..5fe1eb74 100644 --- a/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest3..st +++ b/repository/Zinc-HTTP.package/ZnDefaultServerDelegate.class/instance/formTest3..st @@ -4,7 +4,7 @@ formTest3: request contents := filename := contentType := ''. (request hasEntity and: [ request contentType matches: ZnMimeType multiPartFormData ]) ifTrue: [ - (request entity partNamed: #file ifNone: [ nil ]) + (request entity partNamed: 'file' ifNone: [ nil ]) ifNotNil: [ :part | filename := part fileName. contents := part contents. diff --git a/repository/Zinc-HTTP.package/ZnLogEvent.class/instance/timeStamp.st b/repository/Zinc-HTTP.package/ZnLogEvent.class/instance/timestamp.st similarity index 100% rename from repository/Zinc-HTTP.package/ZnLogEvent.class/instance/timeStamp.st rename to repository/Zinc-HTTP.package/ZnLogEvent.class/instance/timestamp.st diff --git a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method..st b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method..st index 3b0313da..2642de2e 100644 --- a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method..st +++ b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method..st @@ -1,5 +1,6 @@ accessing -method: string +method: aSymbol + method := ZnConstants knownHTTPMethods - detect: [ :each | each = string ] - ifNone: [ (ZnUnknownHttpMethod method: string) signal ] \ No newline at end of file + detect: [ :each | each = aSymbol ] + ifNone: [ (ZnUnknownHttpMethod method: aSymbol) signal ] \ No newline at end of file diff --git a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method.st b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method.st index 66146ebc..bf48cda9 100644 --- a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method.st +++ b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/method.st @@ -1,3 +1,5 @@ accessing method + + ^ method \ No newline at end of file diff --git a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/readFrom..st b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/readFrom..st index ab0cfd0d..c2f28fa0 100644 --- a/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/readFrom..st +++ b/repository/Zinc-HTTP.package/ZnRequestLine.class/instance/readFrom..st @@ -3,6 +3,6 @@ readFrom: stream | line lineStream | line := (ZnLineReader on: stream) nextLine. lineStream := line readStream. - self method: (lineStream upTo: Character space). + self method: (lineStream upTo: Character space) asSymbol. self uri: (lineStream upTo: Character space). self version: (lineStream upToEnd) \ No newline at end of file diff --git a/repository/Zinc-HTTP.package/ZnUtils.class/class/parseHttpDate..st b/repository/Zinc-HTTP.package/ZnUtils.class/class/parseHttpDate..st index 1e15ef12..3fef254a 100644 --- a/repository/Zinc-HTTP.package/ZnUtils.class/class/parseHttpDate..st +++ b/repository/Zinc-HTTP.package/ZnUtils.class/class/parseHttpDate..st @@ -7,7 +7,7 @@ parseHttpDate: string | tokens day month year hour minute second months map yearToken | tokens := (string findTokens: #( $ $- $: $, )) allButFirst. tokens last = 'GMT' ifTrue: [ tokens := tokens allButLast ]. - months := #(jan feb mar apr may jun jul aug sep oct nov dec). + months := #('jan' 'feb' 'mar' 'apr' 'may' 'jun' 'jul' 'aug' 'sep' 'oct' 'nov' 'dec'). (Integer readFrom: tokens first ifFail: [ 0 ]) isZero ifTrue: [ map := #(2 1 6 3 4 5) ] ifFalse: [ map := #(1 2 3 4 5 6) ]. diff --git a/repository/Zinc-HTTP.package/monticello.meta/categories.st b/repository/Zinc-HTTP.package/monticello.meta/categories.st index b4484d8a..f7e23f08 100644 --- a/repository/Zinc-HTTP.package/monticello.meta/categories.st +++ b/repository/Zinc-HTTP.package/monticello.meta/categories.st @@ -1 +1,8 @@ -self packageOrganizer ensurePackage: #'Zinc-HTTP' withTags: #(#'Client-Server' #Core #Exceptions #Logging #Streaming #Support #Variables)! +SystemOrganization addCategory: #'Zinc-HTTP'! +SystemOrganization addCategory: #'Zinc-HTTP-Client-Server'! +SystemOrganization addCategory: #'Zinc-HTTP-Core'! +SystemOrganization addCategory: #'Zinc-HTTP-Exceptions'! +SystemOrganization addCategory: #'Zinc-HTTP-Logging'! +SystemOrganization addCategory: #'Zinc-HTTP-Streaming'! +SystemOrganization addCategory: #'Zinc-HTTP-Support'! +SystemOrganization addCategory: #'Zinc-HTTP-Variables'! diff --git a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testCreate.st b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testCreate.st index 5ecf08ca..fcda3432 100644 --- a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testCreate.st +++ b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testCreate.st @@ -5,7 +5,7 @@ testCreate returned as a JSON string and as the Location header" | data objectUri | - data := Dictionary with: #x -> 'foo' with: #y -> 'bar'. + data := Dictionary with: 'x' -> 'foo' with: 'y' -> 'bar'. client addPathSegment: 'objects'; contents: data; @@ -25,4 +25,4 @@ testCreate self assert: client isSuccess. data keysAndValuesDo: [ :key :value | (client contents at: key) = value ]. - self assert: (client contents at: #'object-uri') equals: objectUri \ No newline at end of file + self assert: (client contents at: 'object-uri') equals: objectUri \ No newline at end of file diff --git a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testQuery.st b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testQuery.st index 92241a47..eec9c002 100644 --- a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testQuery.st +++ b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testQuery.st @@ -3,18 +3,18 @@ testQuery "Any query parameters are seen as a conjunctive filter. Here we execute a GET /storage/object?string=five to find a entry where the key 'string' equals 'five'. Note that the uri is returned." - | data objectUri | + client addPathSegment: 'objects'. 1 to: 10 do: [ :each | - data := Dictionary with: #int -> each with: #string -> each asWords. + data := Dictionary with: 'int' -> each with: 'string' -> each asWords. client contents: data; post. self assert: client isCreated ]. client resetEntity. client - queryAt: #string put: 'five'; + queryAt: 'string' put: 'five'; get. self assert: client isSuccess. objectUri := client contents first. @@ -22,4 +22,4 @@ testQuery url: objectUri; get. self assert: client isSuccess. - self assert: (client contents at: #int) equals: 5 \ No newline at end of file + self assert: (client contents at: 'int') equals: 5 \ No newline at end of file diff --git a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testUpdate.st b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testUpdate.st index ecfd2311..274bd1cb 100644 --- a/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testUpdate.st +++ b/repository/Zinc-REST.package/ZnExampleStorageRestServerDelegateTest.class/instance/testUpdate.st @@ -3,7 +3,7 @@ testUpdate "To update an existing object you PUT a new JSON map representation to an existing uri" | data objectUri | - data := Dictionary with: #x -> 'foo' with: #y -> 'bar'. + data := Dictionary with: 'x' -> 'foo' with: 'y' -> 'bar'. client addPathSegment: 'objects'; contents: data; @@ -11,7 +11,7 @@ testUpdate self assert: client isCreated. objectUri := client response location. client resetEntity. - data at: #z put: 100. + data at: 'z' put: 100. client url: objectUri; contents: data; @@ -22,5 +22,5 @@ testUpdate self assert: client isSuccess. data keysAndValuesDo: [ :key :value | (client contents at: key) = value ]. - self assert: (client contents at: #'object-uri') equals: objectUri. - self assert: (client contents at: #z) equals: 100 \ No newline at end of file + self assert: (client contents at: 'object-uri') equals: objectUri. + self assert: (client contents at: 'z') equals: 100 \ No newline at end of file diff --git a/repository/Zinc-REST.package/monticello.meta/categories.st b/repository/Zinc-REST.package/monticello.meta/categories.st index baa19469..43ba04bc 100644 --- a/repository/Zinc-REST.package/monticello.meta/categories.st +++ b/repository/Zinc-REST.package/monticello.meta/categories.st @@ -1,3 +1,3 @@ SystemOrganization addCategory: #'Zinc-REST'! -SystemOrganization addCategory: 'Zinc-REST-Server'! -SystemOrganization addCategory: 'Zinc-REST-Tests'! +SystemOrganization addCategory: #'Zinc-REST-Server'! +SystemOrganization addCategory: #'Zinc-REST-Tests'! diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/isSchemeNotUsingDoubleSlash..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/isSchemeNotUsingDoubleSlash..st index a3da7b0f..b0618225 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/isSchemeNotUsingDoubleSlash..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/isSchemeNotUsingDoubleSlash..st @@ -1,4 +1,4 @@ private isSchemeNotUsingDoubleSlash: schemeString ^ self class schemesNotUsingDoubleSlash , self class schemesOptionallyNotUsingDoubleSlash - includes: schemeString asLowercase \ No newline at end of file + includes: schemeString asLowercase asSymbol \ No newline at end of file diff --git a/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryAccessing.st b/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryAccessing.st index b7e4ddd8..6b2ac761 100644 --- a/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryAccessing.st +++ b/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryAccessing.st @@ -3,7 +3,7 @@ testQueryAccessing | url | url := 'http://www.google.com/?one=1&two=2' asZnUrl. self assert: url hasQuery. - self assert: url queryKeys sorted equals: #(one two). + self assert: url queryKeys sorted equals: #('one' 'two'). self assert: (url queryAt: 'two' ifAbsent: [ self fail ]) equals: '2'. self assert: (url queryAt: 'three' ifAbsent: [ #missing ]) equals: #missing. url queryAt: 'one' ifPresent: [ :value | self assert: value equals: '1' ]. diff --git a/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryManipulation.st b/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryManipulation.st index 2f1ebfe9..531c68bd 100644 --- a/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryManipulation.st +++ b/repository/Zinc-Resource-Meta-Tests.package/ZnUrlTest.class/instance/testQueryManipulation.st @@ -4,7 +4,7 @@ testQueryManipulation url := 'http://www.google.com/?one=1&two=2' asZnUrl. url queryAt: 'three' put: '3'. url queryRemoveKey: 'one'. - self assert: url queryKeys sorted equals: #(three two). + self assert: url queryKeys sorted equals: #('three' 'two'). self assert: (url queryAt: 'two') equals: '2'. self assert: (url queryAt: 'three') equals: '3'. url queryRemoveAll. diff --git a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testGetGeoIP.st b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testGetGeoIP.st index b2b37a8a..120c6330 100644 --- a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testGetGeoIP.st +++ b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testGetGeoIP.st @@ -14,5 +14,5 @@ testGetGeoIP ifFail: [ ^ self fail ]; get. self assert: result isDictionary. - self assert: (result at: #country) equals: 'BE'. + self assert: (result at: 'country') equals: 'BE'. client close \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testOptions.st b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testOptions.st index c6692818..45f639ea 100644 --- a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testOptions.st +++ b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testOptions.st @@ -6,12 +6,12 @@ testOptions request method = #OPTIONS ifTrue: [ | response | response := ZnResponse noContent. - response headers at: #Allow put: 'GET, HEAD'. + response headers at: 'Allow' put: 'GET, HEAD'. response ] ifFalse: [ ZnResponse badRequest: request ] ]. (client := ZnClient new) options: server localUrl. self assert: client isSuccess. self deny: client response hasEntity. - self assert: (client response headers at: #Allow) equals: 'GET, HEAD'. + self assert: (client response headers at: 'Allow') equals: 'GET, HEAD'. client close ] \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testPatch.st b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testPatch.st index 03f48221..376e08e0 100644 --- a/repository/Zinc-Tests.package/ZnClientTest.class/instance/testPatch.st +++ b/repository/Zinc-Tests.package/ZnClientTest.class/instance/testPatch.st @@ -6,12 +6,12 @@ testPatch request method = #PATCH ifTrue: [| response | response := ZnResponse noContent. - response headers at: #Etag put: '"e0023aa4f"'. + response headers at: 'Etag' put: '"e0023aa4f"'. response] ifFalse: [ ZnResponse badRequest: request ] ]. (client := ZnClient new) patch: server localUrl contents: 'Some data as text'. self assert: client isSuccess. self deny: client response hasEntity. - self assert: (client response headers at: #Etag) equals: '"e0023aa4f"'. + self assert: (client response headers at: 'Etag') equals: '"e0023aa4f"'. client close ] \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnHeadersTest.class/instance/testReadingMultiline.st b/repository/Zinc-Tests.package/ZnHeadersTest.class/instance/testReadingMultiline.st index 5974c19c..543acf5b 100644 --- a/repository/Zinc-Tests.package/ZnHeadersTest.class/instance/testReadingMultiline.st +++ b/repository/Zinc-Tests.package/ZnHeadersTest.class/instance/testReadingMultiline.st @@ -11,5 +11,5 @@ testReadingMultiline self assert: (headers includesKey: 'Content-Length'). self assert: (headers at: 'Content-Type') equals: 'text/plain'. self assert: (headers at: 'Content-Length') equals: '128'. - self assert: (headers includesKey: #Long). - self assert: (headers at: #long) equals: 'foo bar baz' \ No newline at end of file + self assert: (headers includesKey: 'Long'). + self assert: (headers at: 'long') equals: 'foo bar baz' \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnRequestLineTest.class/instance/testWriting.st b/repository/Zinc-Tests.package/ZnRequestLineTest.class/instance/testWriting.st index 807ef9bb..99d37eab 100644 --- a/repository/Zinc-Tests.package/ZnRequestLineTest.class/instance/testWriting.st +++ b/repository/Zinc-Tests.package/ZnRequestLineTest.class/instance/testWriting.st @@ -1,6 +1,6 @@ testing testWriting | requestLine string | - requestLine := ZnRequestLine method: 'GET' uri: '/foo/bar/xyz.txt'. + requestLine := ZnRequestLine method: #GET uri: '/foo/bar/xyz.txt'. string := String streamContents: [ :stream | requestLine writeOn: stream ]. self assert: string equals: 'GET /foo/bar/xyz.txt HTTP/1.1' , String crlf \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnRequestTest.class/instance/testMergedFields.st b/repository/Zinc-Tests.package/ZnRequestTest.class/instance/testMergedFields.st index ee0cdc07..61bb8b73 100644 --- a/repository/Zinc-Tests.package/ZnRequestTest.class/instance/testMergedFields.st +++ b/repository/Zinc-Tests.package/ZnRequestTest.class/instance/testMergedFields.st @@ -4,12 +4,12 @@ testMergedFields request := ZnRequest post: 'http://host.com/foo?x=1&y=2&x=3'. form := ZnApplicationFormUrlEncodedEntity new. form - at: #z put: '100'; - at: #z add: '200'; - at: #y put: '0'. + at: 'z' put: '100'; + at: 'z' add: '200'; + at: 'y' put: '0'. request entity: form. mergedFields := request mergedFields. - self assert: mergedFields keys sorted equals: #(x y z). - self assert: (mergedFields at: #x) sorted equals: #('1' '3'). - self assert: (mergedFields at: #y) sorted equals: #('0' '2'). - self assert: (mergedFields at: #z) sorted equals: #('100' '200') \ No newline at end of file + self assert: mergedFields keys sorted equals: #('x' 'y' 'z'). + self assert: (mergedFields at: 'x') sorted equals: #('1' '3'). + self assert: (mergedFields at: 'y') sorted equals: #('0' '2'). + self assert: (mergedFields at: 'z') sorted equals: #('100' '200') \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnServerTest.class/instance/testFormTest2.st b/repository/Zinc-Tests.package/ZnServerTest.class/instance/testFormTest2.st index 257fc495..b0e4305b 100644 --- a/repository/Zinc-Tests.package/ZnServerTest.class/instance/testFormTest2.st +++ b/repository/Zinc-Tests.package/ZnServerTest.class/instance/testFormTest2.st @@ -8,7 +8,7 @@ testFormTest2 addPathSegment: 'form-test-2'. inputs do: [ :each | client - formAt: #input put: each; + formAt: 'input' put: each; post. self assert: client isSuccess. self assert: (client contents includesSubstring: each) ] ] \ No newline at end of file diff --git a/repository/Zinc-Tests.package/ZnServerTest.class/instance/testLogging.st b/repository/Zinc-Tests.package/ZnServerTest.class/instance/testLogging.st index 6f3a1233..25f53a04 100644 --- a/repository/Zinc-Tests.package/ZnServerTest.class/instance/testLogging.st +++ b/repository/Zinc-Tests.package/ZnServerTest.class/instance/testLogging.st @@ -21,7 +21,7 @@ testLogging client get: (server localUrl addPathSegment: #error). self deny: client isSuccess. server delegate - map: #redirect + map: 'redirect' to: [ :request | ZnResponse redirect: #welcome ]. client get: (server localUrl addPathSegment: #redirect). self assert: client isSuccess.