• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mattonem / PharoJS / 14220696386

11 Mar 2025 04:04PM UTC coverage: 42.026% (-17.4%) from 59.444%
14220696386

push

github

mattonem
more catching

1 of 1 new or added line in 1 file covered. (100.0%)

3707 existing lines in 69 files now uncovered.

8909 of 21199 relevant lines covered (42.03%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Pharo/PharoJs-Base-JS-CoreLibraries-Tests/PjStringTest.class.st
1
Class {
2
        #name : 'PjStringTest',
3
        #superclass : 'PjBridgeTestCase',
4
        #category : 'PharoJs-Base-JS-CoreLibraries-Tests-Collections',
5
        #package : 'PharoJs-Base-JS-CoreLibraries-Tests',
6
        #tag : 'Collections'
7
}
8

9
{ #category : 'tests' }
10
PjStringTest >> testConversion [
×
11
        self assertEquivalent: ['the Eiffel Tower' asUppercase].
×
12
        self assertEquivalent: ['the Eiffel Tower' asLowercase].
×
13
        self assertEquivalent: ['the Eiffel Tower' capitalized].
×
14
]
×
15

16
{ #category : 'tests' }
UNCOV
17
PjStringTest >> testConversionToNumbers [
×
UNCOV
18
        self assertEquivalent: ['07' asInteger].
×
UNCOV
19
        self assertEquivalent: ['3.14' asInteger].
×
UNCOV
20
        self assertEquivalent: ['3.14' asNumber].
×
UNCOV
21
        self assertEquivalent: ['2xyz' asNumber].
×
UNCOV
22
        self assertEquivalent: ['1.41xyz' asNumber].
×
UNCOV
23
]
×
24

25
{ #category : 'tests' }
UNCOV
26
PjStringTest >> testFirst [
×
UNCOV
27
        self assert: ['abc' first] evaluatesTo: 'a'.
×
UNCOV
28
        self assert: ['CBA' first] evaluatesTo: 'C'.
×
UNCOV
29
]
×
30

31
{ #category : 'tests' }
32
PjStringTest >> testIfEmpty [
×
33
        self assertEquivalent: ['abc' ifEmpty: ['xyz']].
×
34
        self assertEquivalent: ['' ifEmpty: ['xyz']].
×
35
]
×
36

37
{ #category : 'tests' }
38
PjStringTest >> testIsAlphanumeric [
×
39
        | digits |
×
40
        digits := Character allByteCharacters select: [: each | each isAlphaNumeric ].
×
41
        self assertBlock: [digits allSatisfy: [: char |char isAlphaNumeric ]].
×
42
]
×
43

44
{ #category : 'tests' }
UNCOV
45
PjStringTest >> testIsDigit [
×
UNCOV
46
        | digits |
×
UNCOV
47
        digits := Character allByteCharacters select: [: each | each isDigit].
×
UNCOV
48
        self assertBlock: [digits allSatisfy: [: char |char isDigit]].
×
UNCOV
49
]
×
50

51
{ #category : 'tests' }
UNCOV
52
PjStringTest >> testIsLetter [
×
UNCOV
53
        | letters nonLetters |
×
UNCOV
54
        letters := Character allByteCharacters select: [: each | each isLetter].
×
UNCOV
55
        self assertBlock: [letters allSatisfy: [: char |char isLetter]].
×
UNCOV
56
        nonLetters := Character allByteCharacters copyWithoutAll: letters.
×
UNCOV
57
        self assertBlock: [nonLetters noneSatisfy: [: char |  char isLetter]].
×
UNCOV
58
]
×
59

60
{ #category : 'tests' }
UNCOV
61
PjStringTest >> testLast [
×
UNCOV
62
        self assert: ['abc' last] evaluatesTo: 'c'.
×
UNCOV
63
        self assert: ['CBA' last] evaluatesTo: 'A'.
×
UNCOV
64
]
×
65

66
{ #category : 'tests' }
UNCOV
67
PjStringTest >> testReversed [
×
UNCOV
68
        self
×
UNCOV
69
                assertEquivalent: ['abcd' reversed].
×
UNCOV
70
]
×
71

72
{ #category : 'tests' }
UNCOV
73
PjStringTest >> testSplit [
×
UNCOV
74
        | splited |
×
UNCOV
75
        splited := self evalBlock: ['.' split: 'a.b.c'].
×
UNCOV
76
        self assert: splited size equals: 3.
×
UNCOV
77
        #(a b c) withIndexDo: [ : expected : index | 
×
UNCOV
78
                self assert: (splited at: index) equals: expected]
×
UNCOV
79
]
×
80

81
{ #category : 'tests' }
82
PjStringTest >> testSplitOn [
×
83

×
84
        self assertEquivalent: [
×
85
                ('a.b.c' splitOn: '.') asArray ]
×
86
]
×
87

88
{ #category : 'tests' }
UNCOV
89
PjStringTest >> testStringHasOrInheritProperty [
×
UNCOV
90

×
UNCOV
91
        | ivName |
×
UNCOV
92
        ivName := #someIv.
×
UNCOV
93
        self denyBlock: [ 'hello!' hasOrInheritsProperty: ivName ].
×
UNCOV
94
        self denyBlock: [
×
UNCOV
95
                | jsString |
×
UNCOV
96
                jsString := 'wonderful'.
×
UNCOV
97
                jsString js_at: ivName put: 42.
×
UNCOV
98
                jsString hasOrInheritsProperty: ivName ]
×
UNCOV
99
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc