Starting tests for notebooks (creation timestamps).
This commit is contained in:
parent
2f9bef131f
commit
7784d99153
@ -81,9 +81,19 @@ GrafoscopioNode >> created: anObject [
|
|||||||
created := anObject
|
created := anObject
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GrafoscopioNode >> earliestCreationDate [
|
||||||
|
| earliest |
|
||||||
|
|
||||||
|
earliest := self nodesWithCreationDates first created.
|
||||||
|
self nodesWithCreationDates do: [:node |
|
||||||
|
node created <= earliest ifTrue: [ earliest := node created ] ].
|
||||||
|
^ earliest
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GrafoscopioNode >> edited [
|
GrafoscopioNode >> edited [
|
||||||
^ edited asDateAndTime
|
^ edited ifNotNil: [^ edited asDateAndTime ]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -139,6 +149,16 @@ GrafoscopioNode >> nodesInPreorder: anObject [
|
|||||||
nodesInPreorder := anObject
|
nodesInPreorder := anObject
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GrafoscopioNode >> nodesWithCreationDates [
|
||||||
|
^ self nodesInPreorder select: [ :each | each created isNotNil ]
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GrafoscopioNode >> nodesWithEditionDates [
|
||||||
|
^ self nodesInPreorder select: [ :each | each edited isNotNil ]
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GrafoscopioNode >> parent [
|
GrafoscopioNode >> parent [
|
||||||
^ parent
|
^ parent
|
||||||
@ -149,6 +169,16 @@ GrafoscopioNode >> parent: anObject [
|
|||||||
parent := anObject
|
parent := anObject
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GrafoscopioNode >> populateTimestamps [
|
||||||
|
|
||||||
|
(self nodesInPreorder size = self nodesWithCreationDates size
|
||||||
|
and: [ self nodesInPreorder size = self nodesWithEditionDates size ])
|
||||||
|
ifTrue: [ ^ self nodesInPreorder ].
|
||||||
|
^ { self nodesWithCreationDates.
|
||||||
|
self nodesWithEditionDates}
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GrafoscopioNode >> printOn: aStream [
|
GrafoscopioNode >> printOn: aStream [
|
||||||
super printOn: aStream.
|
super printOn: aStream.
|
||||||
|
15
src/MiniDocs/GrafoscopioNodeTest.class.st
Normal file
15
src/MiniDocs/GrafoscopioNodeTest.class.st
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Class {
|
||||||
|
#name : #GrafoscopioNodeTest,
|
||||||
|
#superclass : #TestCase,
|
||||||
|
#category : #MiniDocs
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GrafoscopioNodeTest >> testEarliestCreationNode [
|
||||||
|
| notebook remoteNotebook offedingNodes |
|
||||||
|
remoteNotebook := 'https://mutabit.com/repos.fossil/documentaton/raw/a63598382?at=documentaton.ston'.
|
||||||
|
notebook := (STON fromString: remoteNotebook asUrl retrieveContents utf8Decoded) first parent.
|
||||||
|
offedingNodes := notebook nodesInPreorder select: [:node |
|
||||||
|
node created isNotNil and: [node created < notebook earliestCreationDate] ].
|
||||||
|
self assert: offedingNodes size equals: 0
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user