Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion APLSource/Version.aplf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version←Version
version←'3.24.1'
version←'3.24.2'
2 changes: 1 addition & 1 deletion APLSource/read/Paginate.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
((0≡¨lu)/lu)←⊂⊂'null'
(pl nl)←'« Previous' 'Next »'
ll←pl _ ipl,(hc/⊂'...')_ cpl,(hf/⊂'...')_ fpl _ nl ⍝ Link labels
la←'false' 'true'[1+pg=lnkp] ⍝ Link active
la←⊂¨'false' 'true'[1+pg=lnkp] ⍝ Link active (extra enclose makes JSON Boolean type instead of string)
Link←url∘{
link←⎕JSON'{}'
link.(url label active)←⍵
Expand Down
4 changes: 4 additions & 0 deletions Admin/Tests/Assert.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Assert←{
⍺←'assertion failure'
0∊⍵:⍺ ⎕SIGNAL 8
shy←0}
29 changes: 29 additions & 0 deletions Admin/Tests/DummyData/Test_PaginatedResult.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Test_PaginatedResult←{
⍝ This test checks that paginated results have the expected structure and types
H←##.##.##.HttpCommand
Assert←##.Assert
url←⍵,'/videos?per_page=5'
res←H.GetJSON'GET'url
200≠res.HttpStatus:0
0∊⍴res.Data:0
d←res.Data
Type←⊃0∘⍴
Assert 0=Type d.current_page:
Assert 0=Type d.first_page:
Assert 0=Type d.from:
Assert 0=Type d.last_page:
Assert ' '=Type d.last_page_url:
Assert 1=≢⍴d.links:
Assert {9=⎕NC'r'⊣r←⍵}⊃d.links: ⍝ links is a list of namespaces
Assert ∧/' '=Type¨d.links.label:
Assert ∧/' '=Type¨d.links.url:
⍝ The "active" property of a link must be enclosed, which is a Boolean type in JSON
Assert ∧/2=≡¨d.links.active:
Assert ' '=Type d.next_page_url:
Assert ' '=Type d.path:
Assert 0=Type d.per_page:
Assert ' '=Type d.prev_page_url:
Assert 0=Type d.to:
Assert 0=Type d.total:
1
}