?Error in both test and test sorrounding for Bob, a lackadaisical teenager?

Hi again, dear Collin,

as mentioned before I found a very interesting phenomenon

preface
The test case bob(“FCÄEÜCÖDFCßAB”)
in the tests it is categorized to “yell”

I would say that ‘ß’ is not an uppercase letter…
the test in the REPL tells the same.

So the question is: why is it that it should return yell=true?
and my code delivers two different solutions in the REPL and the exercism surrouding:

in the REPL it delivers this:

bob("FCÄEÜCÖDFCßAB")
"Whatever."
bob("FCÄEÜCÖDFCAB")
"Whoa, chill out!

in the exercism surrouding it delivers something else:

bob("FCÄEÜCÖDFCßAB") 
"Whoa, chill out!

the code

function bob(stimulus="") # Comprehension
    stimulus = strip(stimulus) #remove whitespaces at the end after '?' (not at last position)
    if all(isspace, stimulus) # map style, function isspace includes also ""
        return "Fine. Be that way!"
    else
        b_question = false
#       stimulus contains '?' at the end?
        b_question=last(stimulus) == '?'
        b_yell = false
#       at least one letter/ all of them uppercase?
        if any(isuppercase(c) for c in stimulus)
            b_yell = true
        end
#       ALL letters uppercase or punctiation, space, digits or ASCII and not Lowercase?
        # isascii(c) && !islowercase(c) true for "%^*@\$(*^"
        b_yell = b_yell && all(ispunct(c) || isspace(c) || isdigit(c) || isletter(c) && isuppercase(c) || isascii(c) && 
                                !islowercase(c) for c in stimulus) # Comprehension
        if b_question
            if b_yell
                return "Calm down, I know what I'm doing!"
            else
                return "Sure."
            end
        elseif b_yell
            return "Whoa, chill out!"
        else 
            return "Whatever."
        end
    end
end

I’m looking forward to read your answers/comments to that

have a nice christmaas and a good time,

Nisang

ß is a lowercase character.
ẞ is an uppercase character.

This isn’t a test case in the upstream problem-specifications so this was one added by the maintainers. I agree though that this test is misclassified as a yell since ß is a lowercase letter.

Edit - Given the visual similarity between ß and ẞ, I think using a different letter with more distinct lowercase and uppercase versions would avoid confusion for students.

1 Like

I wonder if the Julia test runner uses a UTF locale or not

The REPL disagrees, when I copy the string from runtests.jl - not the same as bob(“FCÄEÜCÖDFCßAB”) in your message. Where did you get that string?

julia> s = collect("FCÄEÜCÖDFCẞAB")
13-element Vector{Char}:
 'F': ASCII/Unicode U+0046 (category Lu: Letter, uppercase)
 'C': ASCII/Unicode U+0043 (category Lu: Letter, uppercase)
 'Ä': Unicode U+00C4 (category Lu: Letter, uppercase)
 'E': ASCII/Unicode U+0045 (category Lu: Letter, uppercase)
 'Ü': Unicode U+00DC (category Lu: Letter, uppercase)
 'C': ASCII/Unicode U+0043 (category Lu: Letter, uppercase)
 'Ö': Unicode U+00D6 (category Lu: Letter, uppercase)
 'D': ASCII/Unicode U+0044 (category Lu: Letter, uppercase)
 'F': ASCII/Unicode U+0046 (category Lu: Letter, uppercase)
 'C': ASCII/Unicode U+0043 (category Lu: Letter, uppercase)
 'ẞ': Unicode U+1E9E (category Lu: Letter, uppercase)
 'A': ASCII/Unicode U+0041 (category Lu: Letter, uppercase)
 'B': ASCII/Unicode U+0042 (category Lu: Letter, uppercase)

julia> all(isuppercase, s)
true

I don’t know the origins of this test, but it is very old: at least 5 years. There have been 1406 starts and 953 completions for the exercise.

I don’t think so. Julia has been all-Unicode from the earliest versions, and avoids local variations if possible.

Good Morning Andras,

this is something I’ve not noticed before
And: I don’t know how to type ‘ẞ’ (uppercase) on my keyboard
it seems I have to use the U code

But: shouldn’t test Case with the ‘ß’ (lowercase) bring the same result in both the REPL AND the exercism surrouding??

have a good time,

Nisang

Good Morning Colin,

this is a good question.
I guess I typed it on my keyboard!

I checked both variations again…
and now it shows a difference for uppercase and lowercase.

AND it is good there’s this way to discuss the topic…
I learn a lot from it!

thanks again!

have a good time,

Nisang

And: I guess: I’ve never seen an existing word with ‘ẞ’ (uppercase) in my whole life as there’s no word in German I know starting with it.

Yeah, it was only officially adopted a decade ago, and even then the recommendation at the time was to write SS instead. I’m not a German speaker so I don’t know how common ẞ is nowadays.

https://qz.com/1033265/germanys-century-long-debate-over-a-missing-letter-in-its-alphabet

I’m also not a native speaker, but I know it varies geographically. I learned German when I lived in Basel back in the 1980’s, and the Swiss wanted nothing to do with this spelling. It was a lot more common just across the German border (only 4 km from my apartment).

1 Like

To summarize, the ẞ used for that particular test case is correctly interpreted as uppercased in both the REPL and in the Exercism test runner. Because all letters are uppercased in that test case, the test is correct in that Bob is yelling. Therefore, no change is needed at this point. Correct?

1 Like

yes!

the usage of ‘ß’ is: some people (not changing to ss) still use it, and it’s mostly used in Names, like Voß

that’s what I say (and the article says it, too):

it’s never had an official uppercase counterpart.

since 2017 it has…
but I bet, that almost no one knows about it!

HI again,

well actually I’d say
NO
now,
as an uppercase ß is possible…
but not used in german language…

So I would recommend to changing the test case to
either
bob(“FCÄEÜCÖDFCßAB”) # (lowercase)
or putting the ‘ẞ’ to the beginning, to make it more clear!:
bob(“ẞFCÄEÜCÖDFCAB”) # (uppercase)

with best wishes,

Nisang