You wrote "I want to test if the response back to the sending node is
the same string as the sending node is but then all uppercased."  What
is wrong with
    received = sent asUppercase
?
If for some reason you don't like that, then
    received class = sent class and: [
    received size = sent size and: [
    received with: sent allSatisfy: [:r :s |
       r = s asUppercase]]]
might do the job, but for two things.
(1)
SequenceableCollection>>
with: another allSatisfy: testBlock
    "Extension of Collection>>allSatisfy: to test whether corresponding
     elements of two sequences already known to be the same length all
     satisfy the given test."
    self with: another do: [:x :y |
        (testBlock value: x value: y)
            ifFalse: [^false]].
    ^true
is not in Pharo 7.
(2) Case conversion in Unicode is *not* a code-point by code-point mapping;
it can change the length of a string.  received = sent asUppercase
is not just the simplest way, it's the safest.

On Tue, 28 Apr 2020 at 05:04, Roelof Wobben via Pharo-users
<pharo-users@lists.pharo.org> wrote:
>
> Op 27-4-2020 om 18:28 schreef Richard Sargent:
>
> On Mon, Apr 27, 2020 at 1:56 AM Roelof Wobben via Pharo-users 
> <pharo-users@lists.pharo.org> wrote:
>>
>> Hello,
>>
>> I have to test the server which should return the string but then in
>> uppercase.
>>
>> So far I have this :
>> https://github.com/RoelofWobben/Network-simulator/blob/master/src/NetworkSimulator-Tests/KANetworkTest.class.st#L79
>>
>> but I fail to see how I can test that the package sending back is a
>> uppercase string.
>
>
> I think you need to rephrase this question. Either the String class hierarchy 
> has a method named something like #isUppercase or Character does. If only 
> Character has it, you would need to iterate over the received string testing 
> each individual character.
>
> Or is your question more about getting the response back to the sending node?
>
>
> yep, I want to test if the response back to the sending node is the same 
> string as the sending node is but then all uppercased.
>
> Roelof
>

Reply via email to