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

mattonem / PharoJS / 13792209801

11 Mar 2025 03:41PM UTC coverage: 59.444% (-3.0%) from 62.432%
13792209801

push

github

mattonem
better

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

751 existing lines in 18 files now uncovered.

12601 of 21198 relevant lines covered (59.44%)

0.59 hits per line

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

0.0
/Pharo/PharoJs-Base-Serialization-Deprecated/PjSerializationTest.class.st
1
Class {
2
        #name : #PjSerializationTest,
3
        #superclass : #PjBridgeTestCase,
4
        #category : #'PharoJs-Base-Serialization-Deprecated-Tests'
5
}
6

7
{ #category : #testing }
UNCOV
8
PjSerializationTest >> testBasicTypes [
×
UNCOV
9
        self assert: [ 'abc' serialize ] evaluatesTo: '["String","abc"]'.
×
UNCOV
10
        self assert: [ 3.14 serialize ] evaluatesTo: '["Number",3.14]'.
×
UNCOV
11
        self assert: [ true serialize ] evaluatesTo: '["Boolean",true]'.
×
UNCOV
12
        self assert: [ nil serialize ] evaluatesTo: '["PjUndefinedObject",{}]'.
×
UNCOV
13
        self assertBlock: [ PjSerializationTestSupport assertEquals: 645].
×
UNCOV
14
        self assertBlock: [ PjSerializationTestSupport assertEquals: 3.14].
×
UNCOV
15
        self assertBlock: [ PjSerializationTestSupport assertEquals: 'hello' ].
×
UNCOV
16
        self assertBlock: [ PjSerializationTestSupport assertIdentity: nil ].
×
UNCOV
17
        self assertBlock: [ PjSerializationTestSupport assertIdentity: true ].
×
UNCOV
18
        self assertBlock: [ PjSerializationTestSupport assertIdentity: false ].
×
UNCOV
19
]
×
20

21
{ #category : #testing }
UNCOV
22
PjSerializationTest >> testCollectionsOfBasicTypes [
×
UNCOV
23
        self assertBlock: [ PjSerializationTestSupport assertCollection: #() ].
×
UNCOV
24
        self assertBlock: [ PjSerializationTestSupport assertCollection: #(1 2 3) ].
×
UNCOV
25
        self assertBlock: [ PjSerializationTestSupport assertCollection: #('abc' 'other' 'yes') ].
×
UNCOV
26
        self assertBlock: [ PjSerializationTestSupport assertCollection: OrderedCollection new ].
×
UNCOV
27
        self assertBlock: [ PjSerializationTestSupport assertCollection: Set new ].
×
UNCOV
28
        self assertBlock: [ 
×
UNCOV
29
                |s|
×
UNCOV
30
                s := Set new.
×
UNCOV
31
                s addAll: #(1 2 3).
×
UNCOV
32
                PjSerializationTestSupport assertCollection: s ].
×
UNCOV
33
        self assertBlock: [ PjSerializationTestSupport assertCollection: SortedCollection new ].
×
UNCOV
34
        self assertBlock: [ 
×
UNCOV
35
                |s|
×
UNCOV
36
                s := SortedCollection new.
×
UNCOV
37
                s addAll: #(310 22 13).
×
UNCOV
38
                PjSerializationTestSupport assertCollection: s ].
×
UNCOV
39
]
×
40

41
{ #category : #testing }
UNCOV
42
PjSerializationTest >> testCollectionsOfComplexTypes [
×
UNCOV
43
        self assertBlock: [ 
×
UNCOV
44
                |s|
×
UNCOV
45
                s := Set new.
×
UNCOV
46
                s addAll: {Time now. 1 hour}.
×
UNCOV
47
                PjSerializationTestSupport assertCollection: s ].
×
UNCOV
48
        self assertBlock: [ 
×
UNCOV
49
                |c1 c2 s|
×
UNCOV
50
                s := Set new.
×
UNCOV
51
                s addAll: {'wonderful'. 'world'}.
×
UNCOV
52
                c1 := PjCompositeForSerializationTest new.
×
UNCOV
53
                c1 a: 456.
×
UNCOV
54
                c1 b: true.
×
UNCOV
55
                c2 := PjCompositeForSerializationTest new.
×
UNCOV
56
                c2 a: s.
×
UNCOV
57
                c2 b: c1.
×
UNCOV
58
                PjSerializationTestSupport assertComplexObject: c2.
×
UNCOV
59
                ].
×
UNCOV
60
]
×
61

62
{ #category : #testing }
UNCOV
63
PjSerializationTest >> testDuration [
×
UNCOV
64
        self assertBlock: [ PjSerializationTestSupport assertDuration: Duration zero].
×
UNCOV
65
        self assertBlock: [ PjSerializationTestSupport assertDuration: 10 years].
×
UNCOV
66
        self assertBlock: [ PjSerializationTestSupport assertDuration: 6 months].
×
UNCOV
67
        self assertBlock: [ PjSerializationTestSupport assertDuration: 2 weeks].
×
UNCOV
68
        self assertBlock: [ PjSerializationTestSupport assertDuration: 2 hours].
×
UNCOV
69
        self assertBlock: [ PjSerializationTestSupport assertDuration: 30 minutes].
×
UNCOV
70
        self assertBlock: [ PjSerializationTestSupport assertDuration: 10 seconds].
×
UNCOV
71
]
×
72

73
{ #category : #testing }
UNCOV
74
PjSerializationTest >> testTime [
×
UNCOV
75
        self assertBlock: [ PjSerializationTestSupport assertTime: Time now].
×
UNCOV
76
        self assertBlock: [ 
×
UNCOV
77
                PjSerializationTestSupport assertTime: (Time hour: 1 minute: 1 second: 13)].
×
UNCOV
78
        self assertBlock: [ 
×
UNCOV
79
                PjSerializationTestSupport assertTime: (Time now seconds: 25)].
×
UNCOV
80
        self assertBlock: [ 
×
UNCOV
81
                PjSerializationTestSupport assertTime: (Time now seconds: 625)].
×
UNCOV
82
        self assertBlock: [ 
×
UNCOV
83
                PjSerializationTestSupport assertTime: (Time noon)].
×
UNCOV
84
        self assertBlock: [ 
×
UNCOV
85
                PjSerializationTestSupport assertTime: (Time midnight)].
×
UNCOV
86
        self assertBlock: [ 
×
UNCOV
87
                PjSerializationTestSupport assertTime: (Time hour: 1 minute: 0 second: 0)].
×
UNCOV
88
        self assertBlock: [ 
×
UNCOV
89
                PjSerializationTestSupport assertTime: (Time hour: 12 minute: 0 second: 0)].
×
UNCOV
90
        self assertBlock: [ 
×
UNCOV
91
                PjSerializationTestSupport assertTime: (Time hour: 13 minute: 0 second: 0)].
×
UNCOV
92
        self assertBlock: [ 
×
UNCOV
93
                PjSerializationTestSupport assertTime: (Time hour: 23 minute: 59 second: 30)].
×
UNCOV
94
]
×
95

96
{ #category : #testing }
UNCOV
97
PjSerializationTest >> testTimeDetailledSerialization [
×
UNCOV
98
        | now clone |
×
UNCOV
99
        now := self evalBlock: [ 
×
UNCOV
100
                                window instVarNamed: #now put: Time now.
×
UNCOV
101
                                 window now.
×
UNCOV
102
        ].
×
UNCOV
103
        clone := self evalBlock: [ PjSerializationTestSupport serializeThenMaterialize: window now].
×
UNCOV
104
        self assert: clone hour24 equals: now hour24.
×
UNCOV
105
        self assert: clone minute equals: now minute.
×
UNCOV
106
        self assert: clone second equals: now second.
×
UNCOV
107
]
×
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