mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-29 09:32:16 +00:00
9ec25d84c5
Adding two basic (fuzz-) tests for Utils.Filter.parseMatcher. Including tests in Travis runs. Adding make target "test" and "dev-server".
32 lines
696 B
Elm
32 lines
696 B
Elm
module Helpers exposing (isNotEmptyTrimmedAlphabetWord)
|
|
|
|
import String
|
|
|
|
|
|
isNotEmptyTrimmedAlphabetWord : String -> Bool
|
|
isNotEmptyTrimmedAlphabetWord string =
|
|
let
|
|
stringLength =
|
|
String.length string
|
|
in
|
|
stringLength
|
|
/= 0
|
|
&& String.length (String.filter isLetter string)
|
|
== stringLength
|
|
|
|
|
|
isLetter : Char -> Bool
|
|
isLetter char =
|
|
String.contains (String.fromChar char) (lowerCaseAlphabet)
|
|
|| String.contains (String.fromChar char) (upperCaseAlphabet)
|
|
|
|
|
|
lowerCaseAlphabet : String
|
|
lowerCaseAlphabet =
|
|
"abcdefghijklmnopqrstuvwxyz"
|
|
|
|
|
|
upperCaseAlphabet : String
|
|
upperCaseAlphabet =
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|