summary refs log tree commit diff stats
path: root/tests/stdlib/tcgi.nim
Commit message (Collapse)AuthorAgeFilesLines
* stdlib tests now check refc too (#21664)ringabout2023-04-211-0/+4
| | | | | | | | | | | * stdlib tests now check refc too * typo * fixes line numbers * disable cpp * do not touch
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* follow #15860 clean cgi module (#16487)flywind2020-12-271-21/+9
| | | | | * follow #15860 clean cgi module * follow #15860 clean cgi module
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ↵Timothee Cour2020-11-281-0/+1
| | | | | | | output spec (#16151) * fix megatest newlines * still allow missing trailing newline for now but in a more strict way than before
* fixes #15369 (#15371)Andreas Rumpf2020-09-201-0/+14
|
* make tests/stdlib tests joinable (#14626)Timothee Cour2020-06-151-0/+6
| | | | | * make tests/stdlib tests joinable * fixup
* require errormsg to be specified before file.Arne Döring2018-12-111-6/+0
|
* Added cgi.readData. Add test for cgi module. (#9645)Constantine Molchanov2018-11-261-0/+23
Added cgi.readData. Add test for cgi module.
066stream.mu?h=main&id=84e4ed1ab58d5b34cf92919aedbb15736a7349d9'>^
8fb0e672 ^
502d2ea5 ^




8fb0e672 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44






                                             
             
                                          




                                                                       


                      
             
                                      


                                                   


                  
             
                                      





                                                                 


                       
             
                                      




                                                   
 
# new type to help incrementally read strings
container stream [
  index:number
  data:address:array:character
]

recipe new-stream [
  local-scope
  result:address:stream <- new stream:type
  i:address:number <- get-address *result, index:offset
  *i <- copy 0
  d:address:address:array:character <- get-address *result, data:offset
  *d <- next-ingredient
  reply result
]

recipe rewind-stream [
  local-scope
  in:address:stream <- next-ingredient
  x:address:number <- get-address *in, index:offset
  *x <- copy 0
  reply in/same-as-arg:0
]

recipe read-line [
  local-scope
  in:address:stream <- next-ingredient
  idx:address:number <- get-address *in, index:offset
  s:address:array:character <- get *in, data:offset
  next-idx:number <- find-next s, 10/newline, *idx
  result:address:array:character <- string-copy s, *idx, next-idx
  *idx <- add next-idx, 1  # skip newline
  reply result
]

recipe end-of-stream? [
  local-scope
  in:address:stream <- next-ingredient
  idx:address:number <- get *in, index:offset
  s:address:array:character <- get *in, data:offset
  len:number <- length *s
  result:boolean <- greater-or-equal idx, len
  reply result
]