Debian Codegraph @

tests/snippets/rego/test_builtin_functions.txt

raw
1 ---input---
2 package test_builtins
3
4 # Comparison
5 test_comparison {
6 1 == 1
7 1 != 2
8 2 > 1
9 2 >= 2
10 1 < 2
11 1 <= 1
12 }
13
14 # Numbers
15 test_numbers {
16 abs(-5) == 5
17 ceil(3.7) == 4
18 floor(3.7) == 3
19 round(3.5) == 4
20 numbers.range(1, 3) == [1, 2, 3]
21 7 / 2 == 3.5
22 7 % 3 == 1
23 }
24
25 # Aggregates
26 test_aggregates {
27 count([1, 2, 3]) == 3
28 sum([1, 2, 3]) == 6
29 product([2, 3, 4]) == 24
30 max([1, 5, 3]) == 5
31 min([1, 5, 3]) == 1
32 sort([3, 1, 2]) == [1, 2, 3]
33 }
34
35 # Arrays
36 test_arrays {
37 array.concat([1, 2], [3, 4]) == [1, 2, 3, 4]
38 array.slice([1, 2, 3, 4], 1, 3) == [2, 3]
39 array.reverse([1, 2, 3]) == [3, 2, 1]
40 }
41
42 # Sets
43 test_sets {
44 {1, 2} & {2, 3} == {2}
45 {1, 2} | {2, 3} == {1, 2, 3}
46 {1, 2, 3} - {2} == {1, 3}
47 intersection({{1, 2}, {2, 3}}) == {2}
48 union({{1, 2}, {2, 3}}) == {1, 2, 3}
49 }
50
51 # Objects
52 test_objects {
53 object.get({"a": 1, "b": 2}, "a", 0) == 1
54 object.get({"a": 1, "b": 2}, "c", 0) == 0
55 object.remove({"a": 1, "b": 2}, ["a"]) == {"b": 2}
56 object.union({"a": 1}, {"b": 2}) == {"a": 1, "b": 2}
57 }
58
59 # Strings
60 test_strings {
61 contains("abcde", "bc")
62 startswith("abcde", "ab")
63 endswith("abcde", "de")
64 lower("AbC") == "abc"
65 upper("aBc") == "ABC"
66 trim(" abc ") == "abc"
67 split("a,b,c", ",") == ["a", "b", "c"]
68 replace("aabbcc", "b", "d") == "aaddcc"
69 sprintf("%s %d", ["foo", 5]) == "foo 5"
70 }
71
72 # Regex
73 test_regex {
74 regex.match("^a[bc]+d$", "abcd")
75 regex.split(":", "a:b:c") == ["a", "b", "c"]
76 regex.find_n("[a-z]", "a1b2c3", -1) == ["a", "b", "c"]
77 }
78
79 # Glob
80 test_glob {
81 glob.match("*.txt", ["."], "file.txt")
82 not glob.match("*.txt", ["."], "file.jpg")
83 }
84
85 # Type checks
86 test_types {
87 is_number(5)
88 is_string("abc")
89 is_boolean(true)
90 is_array([1, 2, 3])
91 is_set({1, 2, 3})
92 is_object({"a": 1})
93 is_null(null)
94 type_name(5) == "number"
95 }
96
97 # Encoding
98 test_encoding {
99 base64.encode("hello") == "aGVsbG8="
100 base64.decode("aGVsbG8=") == "hello"
101 json.marshal({"a": 1}) == "{\"a\":1}"
102 json.unmarshal("{\"a\":1}") == {"a": 1}
103 }
104
105 # Time
106 test_time {
107 time.now_ns() > 0
108 time.parse_duration_ns("1h") == 3600000000000
109 parsed := time.parse_rfc3339_ns("2006-01-02T15:04:05Z")
110 [year, month, day] := time.date(parsed)
111 year == 2006
112 month == 1
113 day == 2
114 }
115
116 # Crypto
117 test_crypto {
118 crypto.md5("hello") == "5d41402abc4b2a76b9719d911017c592"
119 crypto.sha1("hello") == "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"
120 crypto.sha256("hello") == "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
121 }
122
123 # Net
124 test_net {
125 net.cidr_contains("192.168.1.0/24", "192.168.1.100")
126 not net.cidr_contains("192.168.1.0/24", "192.168.2.100")
127 }
128
129 # Graphs
130 test_graphs {
131 graph := {"a": ["b", "c"], "b": ["d"], "c": ["d"], "d": []}
132 graph.reachable(graph, {"a"}) == {"a", "b", "c", "d"}
133 }
134
135 # HTTP and JWTs (mocked)
136 mock_http_send(request) = http_response if {
137 request.url == "https://example.com"
138 http_response := {
139 "status": "200 OK",
140 "status_code": 200,
141 "body": "{\"key\": \"value\"}",
142 }
143 }
144
145 test_http_and_jwt {
146 http.send({"method": "GET", "url": "https://example.com"}) == mock_http_send({"method": "GET", "url": "https://example.com"})
147 io.jwt.encode_sign({"alg": "HS256"}, {"sub": "1234567890"}, {"kty": "oct", "k": "secret"})
148 }
149
150 # UUID
151 test_uuid {
152 uuid := uuid.rfc4122("test")
153 startswith(uuid, "") # Always true, just to use the uuid variable
154 uuid2 := uuid.rfc4122("test")
155 uuid == uuid2 # Consistent for the same input
156 }
157
158 # Rego
159 test_rego {
160 parsed := rego.parse_module("test.rego", "package test")
161 parsed.package.path[0].value == "test"
162 }
163
164 # OPA Runtime
165 test_opa_runtime {
166 runtime := opa.runtime()
167 is_object(runtime)
168 }
169
170 ---tokens---
171 'package' Keyword
172 ' ' Text.Whitespace
173 'test_builtins' Name
174 '\n' Text.Whitespace
175
176 '\n' Text.Whitespace
177
178 '# Comparison' Comment.Single
179 '\n' Text.Whitespace
180
181 'test_comparison' Name
182 ' ' Text.Whitespace
183 '{' Punctuation
184 '\n' Text.Whitespace
185
186 ' ' Text.Whitespace
187 '1' Literal.Number
188 ' ' Text.Whitespace
189 '==' Operator
190 ' ' Text.Whitespace
191 '1' Literal.Number
192 '\n' Text.Whitespace
193
194 ' ' Text.Whitespace
195 '1' Literal.Number
196 ' ' Text.Whitespace
197 '!=' Operator
198 ' ' Text.Whitespace
199 '2' Literal.Number
200 '\n' Text.Whitespace
201
202 ' ' Text.Whitespace
203 '2' Literal.Number
204 ' ' Text.Whitespace
205 '>' Operator
206 ' ' Text.Whitespace
207 '1' Literal.Number
208 '\n' Text.Whitespace
209
210 ' ' Text.Whitespace
211 '2' Literal.Number
212 ' ' Text.Whitespace
213 '>=' Operator
214 ' ' Text.Whitespace
215 '2' Literal.Number
216 '\n' Text.Whitespace
217
218 ' ' Text.Whitespace
219 '1' Literal.Number
220 ' ' Text.Whitespace
221 '<' Operator
222 ' ' Text.Whitespace
223 '2' Literal.Number
224 '\n' Text.Whitespace
225
226 ' ' Text.Whitespace
227 '1' Literal.Number
228 ' ' Text.Whitespace
229 '<=' Operator
230 ' ' Text.Whitespace
231 '1' Literal.Number
232 '\n' Text.Whitespace
233
234 '}' Punctuation
235 '\n' Text.Whitespace
236
237 '\n' Text.Whitespace
238
239 '# Numbers' Comment.Single
240 '\n' Text.Whitespace
241
242 'test_numbers' Name
243 ' ' Text.Whitespace
244 '{' Punctuation
245 '\n' Text.Whitespace
246
247 ' ' Text.Whitespace
248 'abs' Name
249 '(' Punctuation
250 '-5' Literal.Number
251 ')' Punctuation
252 ' ' Text.Whitespace
253 '==' Operator
254 ' ' Text.Whitespace
255 '5' Literal.Number
256 '\n' Text.Whitespace
257
258 ' ' Text.Whitespace
259 'ceil' Name
260 '(' Punctuation
261 '3.7' Literal.Number
262 ')' Punctuation
263 ' ' Text.Whitespace
264 '==' Operator
265 ' ' Text.Whitespace
266 '4' Literal.Number
267 '\n' Text.Whitespace
268
269 ' ' Text.Whitespace
270 'floor' Name
271 '(' Punctuation
272 '3.7' Literal.Number
273 ')' Punctuation
274 ' ' Text.Whitespace
275 '==' Operator
276 ' ' Text.Whitespace
277 '3' Literal.Number
278 '\n' Text.Whitespace
279
280 ' ' Text.Whitespace
281 'round' Name
282 '(' Punctuation
283 '3.5' Literal.Number
284 ')' Punctuation
285 ' ' Text.Whitespace
286 '==' Operator
287 ' ' Text.Whitespace
288 '4' Literal.Number
289 '\n' Text.Whitespace
290
291 ' ' Text.Whitespace
292 'numbers' Name
293 '.' Punctuation
294 'range' Name
295 '(' Punctuation
296 '1' Literal.Number
297 ',' Punctuation
298 ' ' Text.Whitespace
299 '3' Literal.Number
300 ')' Punctuation
301 ' ' Text.Whitespace
302 '==' Operator
303 ' ' Text.Whitespace
304 '[' Punctuation
305 '1' Literal.Number
306 ',' Punctuation
307 ' ' Text.Whitespace
308 '2' Literal.Number
309 ',' Punctuation
310 ' ' Text.Whitespace
311 '3' Literal.Number
312 ']' Punctuation
313 '\n' Text.Whitespace
314
315 ' ' Text.Whitespace
316 '7' Literal.Number
317 ' ' Text.Whitespace
318 '/' Operator
319 ' ' Text.Whitespace
320 '2' Literal.Number
321 ' ' Text.Whitespace
322 '==' Operator
323 ' ' Text.Whitespace
324 '3.5' Literal.Number
325 '\n' Text.Whitespace
326
327 ' ' Text.Whitespace
328 '7' Literal.Number
329 ' ' Text.Whitespace
330 '%' Operator
331 ' ' Text.Whitespace
332 '3' Literal.Number
333 ' ' Text.Whitespace
334 '==' Operator
335 ' ' Text.Whitespace
336 '1' Literal.Number
337 '\n' Text.Whitespace
338
339 '}' Punctuation
340 '\n' Text.Whitespace
341
342 '\n' Text.Whitespace
343
344 '# Aggregates' Comment.Single
345 '\n' Text.Whitespace
346
347 'test_aggregates' Name
348 ' ' Text.Whitespace
349 '{' Punctuation
350 '\n' Text.Whitespace
351
352 ' ' Text.Whitespace
353 'count' Name
354 '(' Punctuation
355 '[' Punctuation
356 '1' Literal.Number
357 ',' Punctuation
358 ' ' Text.Whitespace
359 '2' Literal.Number
360 ',' Punctuation
361 ' ' Text.Whitespace
362 '3' Literal.Number
363 ']' Punctuation
364 ')' Punctuation
365 ' ' Text.Whitespace
366 '==' Operator
367 ' ' Text.Whitespace
368 '3' Literal.Number
369 '\n' Text.Whitespace
370
371 ' ' Text.Whitespace
372 'sum' Name
373 '(' Punctuation
374 '[' Punctuation
375 '1' Literal.Number
376 ',' Punctuation
377 ' ' Text.Whitespace
378 '2' Literal.Number
379 ',' Punctuation
380 ' ' Text.Whitespace
381 '3' Literal.Number
382 ']' Punctuation
383 ')' Punctuation
384 ' ' Text.Whitespace
385 '==' Operator
386 ' ' Text.Whitespace
387 '6' Literal.Number
388 '\n' Text.Whitespace
389
390 ' ' Text.Whitespace
391 'product' Name
392 '(' Punctuation
393 '[' Punctuation
394 '2' Literal.Number
395 ',' Punctuation
396 ' ' Text.Whitespace
397 '3' Literal.Number
398 ',' Punctuation
399 ' ' Text.Whitespace
400 '4' Literal.Number
401 ']' Punctuation
402 ')' Punctuation
403 ' ' Text.Whitespace
404 '==' Operator
405 ' ' Text.Whitespace
406 '24' Literal.Number
407 '\n' Text.Whitespace
408
409 ' ' Text.Whitespace
410 'max' Name
411 '(' Punctuation
412 '[' Punctuation
413 '1' Literal.Number
414 ',' Punctuation
415 ' ' Text.Whitespace
416 '5' Literal.Number
417 ',' Punctuation
418 ' ' Text.Whitespace
419 '3' Literal.Number
420 ']' Punctuation
421 ')' Punctuation
422 ' ' Text.Whitespace
423 '==' Operator
424 ' ' Text.Whitespace
425 '5' Literal.Number
426 '\n' Text.Whitespace
427
428 ' ' Text.Whitespace
429 'min' Name
430 '(' Punctuation
431 '[' Punctuation
432 '1' Literal.Number
433 ',' Punctuation
434 ' ' Text.Whitespace
435 '5' Literal.Number
436 ',' Punctuation
437 ' ' Text.Whitespace
438 '3' Literal.Number
439 ']' Punctuation
440 ')' Punctuation
441 ' ' Text.Whitespace
442 '==' Operator
443 ' ' Text.Whitespace
444 '1' Literal.Number
445 '\n' Text.Whitespace
446
447 ' ' Text.Whitespace
448 'sort' Name
449 '(' Punctuation
450 '[' Punctuation
451 '3' Literal.Number
452 ',' Punctuation
453 ' ' Text.Whitespace
454 '1' Literal.Number
455 ',' Punctuation
456 ' ' Text.Whitespace
457 '2' Literal.Number
458 ']' Punctuation
459 ')' Punctuation
460 ' ' Text.Whitespace
461 '==' Operator
462 ' ' Text.Whitespace
463 '[' Punctuation
464 '1' Literal.Number
465 ',' Punctuation
466 ' ' Text.Whitespace
467 '2' Literal.Number
468 ',' Punctuation
469 ' ' Text.Whitespace
470 '3' Literal.Number
471 ']' Punctuation
472 '\n' Text.Whitespace
473
474 '}' Punctuation
475 '\n' Text.Whitespace
476
477 '\n' Text.Whitespace
478
479 '# Arrays' Comment.Single
480 '\n' Text.Whitespace
481
482 'test_arrays' Name
483 ' ' Text.Whitespace
484 '{' Punctuation
485 '\n' Text.Whitespace
486
487 ' ' Text.Whitespace
488 'array' Name
489 '.' Punctuation
490 'concat' Name
491 '(' Punctuation
492 '[' Punctuation
493 '1' Literal.Number
494 ',' Punctuation
495 ' ' Text.Whitespace
496 '2' Literal.Number
497 ']' Punctuation
498 ',' Punctuation
499 ' ' Text.Whitespace
500 '[' Punctuation
501 '3' Literal.Number
502 ',' Punctuation
503 ' ' Text.Whitespace
504 '4' Literal.Number
505 ']' Punctuation
506 ')' Punctuation
507 ' ' Text.Whitespace
508 '==' Operator
509 ' ' Text.Whitespace
510 '[' Punctuation
511 '1' Literal.Number
512 ',' Punctuation
513 ' ' Text.Whitespace
514 '2' Literal.Number
515 ',' Punctuation
516 ' ' Text.Whitespace
517 '3' Literal.Number
518 ',' Punctuation
519 ' ' Text.Whitespace
520 '4' Literal.Number
521 ']' Punctuation
522 '\n' Text.Whitespace
523
524 ' ' Text.Whitespace
525 'array' Name
526 '.' Punctuation
527 'slice' Name
528 '(' Punctuation
529 '[' Punctuation
530 '1' Literal.Number
531 ',' Punctuation
532 ' ' Text.Whitespace
533 '2' Literal.Number
534 ',' Punctuation
535 ' ' Text.Whitespace
536 '3' Literal.Number
537 ',' Punctuation
538 ' ' Text.Whitespace
539 '4' Literal.Number
540 ']' Punctuation
541 ',' Punctuation
542 ' ' Text.Whitespace
543 '1' Literal.Number
544 ',' Punctuation
545 ' ' Text.Whitespace
546 '3' Literal.Number
547 ')' Punctuation
548 ' ' Text.Whitespace
549 '==' Operator
550 ' ' Text.Whitespace
551 '[' Punctuation
552 '2' Literal.Number
553 ',' Punctuation
554 ' ' Text.Whitespace
555 '3' Literal.Number
556 ']' Punctuation
557 '\n' Text.Whitespace
558
559 ' ' Text.Whitespace
560 'array' Name
561 '.' Punctuation
562 'reverse' Name
563 '(' Punctuation
564 '[' Punctuation
565 '1' Literal.Number
566 ',' Punctuation
567 ' ' Text.Whitespace
568 '2' Literal.Number
569 ',' Punctuation
570 ' ' Text.Whitespace
571 '3' Literal.Number
572 ']' Punctuation
573 ')' Punctuation
574 ' ' Text.Whitespace
575 '==' Operator
576 ' ' Text.Whitespace
577 '[' Punctuation
578 '3' Literal.Number
579 ',' Punctuation
580 ' ' Text.Whitespace
581 '2' Literal.Number
582 ',' Punctuation
583 ' ' Text.Whitespace
584 '1' Literal.Number
585 ']' Punctuation
586 '\n' Text.Whitespace
587
588 '}' Punctuation
589 '\n' Text.Whitespace
590
591 '\n' Text.Whitespace
592
593 '# Sets' Comment.Single
594 '\n' Text.Whitespace
595
596 'test_sets' Name
597 ' ' Text.Whitespace
598 '{' Punctuation
599 '\n' Text.Whitespace
600
601 ' ' Text.Whitespace
602 '{' Punctuation
603 '1' Literal.Number
604 ',' Punctuation
605 ' ' Text.Whitespace
606 '2' Literal.Number
607 '}' Punctuation
608 ' ' Text.Whitespace
609 '&' Operator
610 ' ' Text.Whitespace
611 '{' Punctuation
612 '2' Literal.Number
613 ',' Punctuation
614 ' ' Text.Whitespace
615 '3' Literal.Number
616 '}' Punctuation
617 ' ' Text.Whitespace
618 '==' Operator
619 ' ' Text.Whitespace
620 '{' Punctuation
621 '2' Literal.Number
622 '}' Punctuation
623 '\n' Text.Whitespace
624
625 ' ' Text.Whitespace
626 '{' Punctuation
627 '1' Literal.Number
628 ',' Punctuation
629 ' ' Text.Whitespace
630 '2' Literal.Number
631 '}' Punctuation
632 ' ' Text.Whitespace
633 '|' Operator
634 ' ' Text.Whitespace
635 '{' Punctuation
636 '2' Literal.Number
637 ',' Punctuation
638 ' ' Text.Whitespace
639 '3' Literal.Number
640 '}' Punctuation
641 ' ' Text.Whitespace
642 '==' Operator
643 ' ' Text.Whitespace
644 '{' Punctuation
645 '1' Literal.Number
646 ',' Punctuation
647 ' ' Text.Whitespace
648 '2' Literal.Number
649 ',' Punctuation
650 ' ' Text.Whitespace
651 '3' Literal.Number
652 '}' Punctuation
653 '\n' Text.Whitespace
654
655 ' ' Text.Whitespace
656 '{' Punctuation
657 '1' Literal.Number
658 ',' Punctuation
659 ' ' Text.Whitespace
660 '2' Literal.Number
661 ',' Punctuation
662 ' ' Text.Whitespace
663 '3' Literal.Number
664 '}' Punctuation
665 ' ' Text.Whitespace
666 '-' Operator
667 ' ' Text.Whitespace
668 '{' Punctuation
669 '2' Literal.Number
670 '}' Punctuation
671 ' ' Text.Whitespace
672 '==' Operator
673 ' ' Text.Whitespace
674 '{' Punctuation
675 '1' Literal.Number
676 ',' Punctuation
677 ' ' Text.Whitespace
678 '3' Literal.Number
679 '}' Punctuation
680 '\n' Text.Whitespace
681
682 ' ' Text.Whitespace
683 'intersection' Name
684 '(' Punctuation
685 '{' Punctuation
686 '{' Punctuation
687 '1' Literal.Number
688 ',' Punctuation
689 ' ' Text.Whitespace
690 '2' Literal.Number
691 '}' Punctuation
692 ',' Punctuation
693 ' ' Text.Whitespace
694 '{' Punctuation
695 '2' Literal.Number
696 ',' Punctuation
697 ' ' Text.Whitespace
698 '3' Literal.Number
699 '}' Punctuation
700 '}' Punctuation
701 ')' Punctuation
702 ' ' Text.Whitespace
703 '==' Operator
704 ' ' Text.Whitespace
705 '{' Punctuation
706 '2' Literal.Number
707 '}' Punctuation
708 '\n' Text.Whitespace
709
710 ' ' Text.Whitespace
711 'union' Name
712 '(' Punctuation
713 '{' Punctuation
714 '{' Punctuation
715 '1' Literal.Number
716 ',' Punctuation
717 ' ' Text.Whitespace
718 '2' Literal.Number
719 '}' Punctuation
720 ',' Punctuation
721 ' ' Text.Whitespace
722 '{' Punctuation
723 '2' Literal.Number
724 ',' Punctuation
725 ' ' Text.Whitespace
726 '3' Literal.Number
727 '}' Punctuation
728 '}' Punctuation
729 ')' Punctuation
730 ' ' Text.Whitespace
731 '==' Operator
732 ' ' Text.Whitespace
733 '{' Punctuation
734 '1' Literal.Number
735 ',' Punctuation
736 ' ' Text.Whitespace
737 '2' Literal.Number
738 ',' Punctuation
739 ' ' Text.Whitespace
740 '3' Literal.Number
741 '}' Punctuation
742 '\n' Text.Whitespace
743
744 '}' Punctuation
745 '\n' Text.Whitespace
746
747 '\n' Text.Whitespace
748
749 '# Objects' Comment.Single
750 '\n' Text.Whitespace
751
752 'test_objects' Name
753 ' ' Text.Whitespace
754 '{' Punctuation
755 '\n' Text.Whitespace
756
757 ' ' Text.Whitespace
758 'object' Name
759 '.' Punctuation
760 'get' Name
761 '(' Punctuation
762 '{' Punctuation
763 '"a"' Literal.String.Double
764 ':' Punctuation
765 ' ' Text.Whitespace
766 '1' Literal.Number
767 ',' Punctuation
768 ' ' Text.Whitespace
769 '"b"' Literal.String.Double
770 ':' Punctuation
771 ' ' Text.Whitespace
772 '2' Literal.Number
773 '}' Punctuation
774 ',' Punctuation
775 ' ' Text.Whitespace
776 '"a"' Literal.String.Double
777 ',' Punctuation
778 ' ' Text.Whitespace
779 '0' Literal.Number
780 ')' Punctuation
781 ' ' Text.Whitespace
782 '==' Operator
783 ' ' Text.Whitespace
784 '1' Literal.Number
785 '\n' Text.Whitespace
786
787 ' ' Text.Whitespace
788 'object' Name
789 '.' Punctuation
790 'get' Name
791 '(' Punctuation
792 '{' Punctuation
793 '"a"' Literal.String.Double
794 ':' Punctuation
795 ' ' Text.Whitespace
796 '1' Literal.Number
797 ',' Punctuation
798 ' ' Text.Whitespace
799 '"b"' Literal.String.Double
800 ':' Punctuation
801 ' ' Text.Whitespace
802 '2' Literal.Number
803 '}' Punctuation
804 ',' Punctuation
805 ' ' Text.Whitespace
806 '"c"' Literal.String.Double
807 ',' Punctuation
808 ' ' Text.Whitespace
809 '0' Literal.Number
810 ')' Punctuation
811 ' ' Text.Whitespace
812 '==' Operator
813 ' ' Text.Whitespace
814 '0' Literal.Number
815 '\n' Text.Whitespace
816
817 ' ' Text.Whitespace
818 'object' Name
819 '.' Punctuation
820 'remove' Name
821 '(' Punctuation
822 '{' Punctuation
823 '"a"' Literal.String.Double
824 ':' Punctuation
825 ' ' Text.Whitespace
826 '1' Literal.Number
827 ',' Punctuation
828 ' ' Text.Whitespace
829 '"b"' Literal.String.Double
830 ':' Punctuation
831 ' ' Text.Whitespace
832 '2' Literal.Number
833 '}' Punctuation
834 ',' Punctuation
835 ' ' Text.Whitespace
836 '[' Punctuation
837 '"a"' Literal.String.Double
838 ']' Punctuation
839 ')' Punctuation
840 ' ' Text.Whitespace
841 '==' Operator
842 ' ' Text.Whitespace
843 '{' Punctuation
844 '"b"' Literal.String.Double
845 ':' Punctuation
846 ' ' Text.Whitespace
847 '2' Literal.Number
848 '}' Punctuation
849 '\n' Text.Whitespace
850
851 ' ' Text.Whitespace
852 'object' Name
853 '.' Punctuation
854 'union' Name
855 '(' Punctuation
856 '{' Punctuation
857 '"a"' Literal.String.Double
858 ':' Punctuation
859 ' ' Text.Whitespace
860 '1' Literal.Number
861 '}' Punctuation
862 ',' Punctuation
863 ' ' Text.Whitespace
864 '{' Punctuation
865 '"b"' Literal.String.Double
866 ':' Punctuation
867 ' ' Text.Whitespace
868 '2' Literal.Number
869 '}' Punctuation
870 ')' Punctuation
871 ' ' Text.Whitespace
872 '==' Operator
873 ' ' Text.Whitespace
874 '{' Punctuation
875 '"a"' Literal.String.Double
876 ':' Punctuation
877 ' ' Text.Whitespace
878 '1' Literal.Number
879 ',' Punctuation
880 ' ' Text.Whitespace
881 '"b"' Literal.String.Double
882 ':' Punctuation
883 ' ' Text.Whitespace
884 '2' Literal.Number
885 '}' Punctuation
886 '\n' Text.Whitespace
887
888 '}' Punctuation
889 '\n' Text.Whitespace
890
891 '\n' Text.Whitespace
892
893 '# Strings' Comment.Single
894 '\n' Text.Whitespace
895
896 'test_strings' Name
897 ' ' Text.Whitespace
898 '{' Punctuation
899 '\n' Text.Whitespace
900
901 ' ' Text.Whitespace
902 'contains' Keyword
903 '(' Punctuation
904 '"abcde"' Literal.String.Double
905 ',' Punctuation
906 ' ' Text.Whitespace
907 '"bc"' Literal.String.Double
908 ')' Punctuation
909 '\n' Text.Whitespace
910
911 ' ' Text.Whitespace
912 'startswith' Name
913 '(' Punctuation
914 '"abcde"' Literal.String.Double
915 ',' Punctuation
916 ' ' Text.Whitespace
917 '"ab"' Literal.String.Double
918 ')' Punctuation
919 '\n' Text.Whitespace
920
921 ' ' Text.Whitespace
922 'endswith' Name
923 '(' Punctuation
924 '"abcde"' Literal.String.Double
925 ',' Punctuation
926 ' ' Text.Whitespace
927 '"de"' Literal.String.Double
928 ')' Punctuation
929 '\n' Text.Whitespace
930
931 ' ' Text.Whitespace
932 'lower' Name
933 '(' Punctuation
934 '"AbC"' Literal.String.Double
935 ')' Punctuation
936 ' ' Text.Whitespace
937 '==' Operator
938 ' ' Text.Whitespace
939 '"abc"' Literal.String.Double
940 '\n' Text.Whitespace
941
942 ' ' Text.Whitespace
943 'upper' Name
944 '(' Punctuation
945 '"aBc"' Literal.String.Double
946 ')' Punctuation
947 ' ' Text.Whitespace
948 '==' Operator
949 ' ' Text.Whitespace
950 '"ABC"' Literal.String.Double
951 '\n' Text.Whitespace
952
953 ' ' Text.Whitespace
954 'trim' Name
955 '(' Punctuation
956 '" abc "' Literal.String.Double
957 ')' Punctuation
958 ' ' Text.Whitespace
959 '==' Operator
960 ' ' Text.Whitespace
961 '"abc"' Literal.String.Double
962 '\n' Text.Whitespace
963
964 ' ' Text.Whitespace
965 'split' Name
966 '(' Punctuation
967 '"a,b,c"' Literal.String.Double
968 ',' Punctuation
969 ' ' Text.Whitespace
970 '","' Literal.String.Double
971 ')' Punctuation
972 ' ' Text.Whitespace
973 '==' Operator
974 ' ' Text.Whitespace
975 '[' Punctuation
976 '"a"' Literal.String.Double
977 ',' Punctuation
978 ' ' Text.Whitespace
979 '"b"' Literal.String.Double
980 ',' Punctuation
981 ' ' Text.Whitespace
982 '"c"' Literal.String.Double
983 ']' Punctuation
984 '\n' Text.Whitespace
985
986 ' ' Text.Whitespace
987 'replace' Name
988 '(' Punctuation
989 '"aabbcc"' Literal.String.Double
990 ',' Punctuation
991 ' ' Text.Whitespace
992 '"b"' Literal.String.Double
993 ',' Punctuation
994 ' ' Text.Whitespace
995 '"d"' Literal.String.Double
996 ')' Punctuation
997 ' ' Text.Whitespace
998 '==' Operator
999 ' ' Text.Whitespace
1000 '"aaddcc"' Literal.String.Double
1001 '\n' Text.Whitespace
1002
1003 ' ' Text.Whitespace
1004 'sprintf' Name
1005 '(' Punctuation
1006 '"%s %d"' Literal.String.Double
1007 ',' Punctuation
1008 ' ' Text.Whitespace
1009 '[' Punctuation
1010 '"foo"' Literal.String.Double
1011 ',' Punctuation
1012 ' ' Text.Whitespace
1013 '5' Literal.Number
1014 ']' Punctuation
1015 ')' Punctuation
1016 ' ' Text.Whitespace
1017 '==' Operator
1018 ' ' Text.Whitespace
1019 '"foo 5"' Literal.String.Double
1020 '\n' Text.Whitespace
1021
1022 '}' Punctuation
1023 '\n' Text.Whitespace
1024
1025 '\n' Text.Whitespace
1026
1027 '# Regex' Comment.Single
1028 '\n' Text.Whitespace
1029
1030 'test_regex' Name
1031 ' ' Text.Whitespace
1032 '{' Punctuation
1033 '\n' Text.Whitespace
1034
1035 ' ' Text.Whitespace
1036 'regex' Name
1037 '.' Punctuation
1038 'match' Name
1039 '(' Punctuation
1040 '"^a[bc]+d$"' Literal.String.Double
1041 ',' Punctuation
1042 ' ' Text.Whitespace
1043 '"abcd"' Literal.String.Double
1044 ')' Punctuation
1045 '\n' Text.Whitespace
1046
1047 ' ' Text.Whitespace
1048 'regex' Name
1049 '.' Punctuation
1050 'split' Name
1051 '(' Punctuation
1052 '":"' Literal.String.Double
1053 ',' Punctuation
1054 ' ' Text.Whitespace
1055 '"a:b:c"' Literal.String.Double
1056 ')' Punctuation
1057 ' ' Text.Whitespace
1058 '==' Operator
1059 ' ' Text.Whitespace
1060 '[' Punctuation
1061 '"a"' Literal.String.Double
1062 ',' Punctuation
1063 ' ' Text.Whitespace
1064 '"b"' Literal.String.Double
1065 ',' Punctuation
1066 ' ' Text.Whitespace
1067 '"c"' Literal.String.Double
1068 ']' Punctuation
1069 '\n' Text.Whitespace
1070
1071 ' ' Text.Whitespace
1072 'regex' Name
1073 '.' Punctuation
1074 'find_n' Name
1075 '(' Punctuation
1076 '"[a-z]"' Literal.String.Double
1077 ',' Punctuation
1078 ' ' Text.Whitespace
1079 '"a1b2c3"' Literal.String.Double
1080 ',' Punctuation
1081 ' ' Text.Whitespace
1082 '-1' Literal.Number
1083 ')' Punctuation
1084 ' ' Text.Whitespace
1085 '==' Operator
1086 ' ' Text.Whitespace
1087 '[' Punctuation
1088 '"a"' Literal.String.Double
1089 ',' Punctuation
1090 ' ' Text.Whitespace
1091 '"b"' Literal.String.Double
1092 ',' Punctuation
1093 ' ' Text.Whitespace
1094 '"c"' Literal.String.Double
1095 ']' Punctuation
1096 '\n' Text.Whitespace
1097
1098 '}' Punctuation
1099 '\n' Text.Whitespace
1100
1101 '\n' Text.Whitespace
1102
1103 '# Glob' Comment.Single
1104 '\n' Text.Whitespace
1105
1106 'test_glob' Name
1107 ' ' Text.Whitespace
1108 '{' Punctuation
1109 '\n' Text.Whitespace
1110
1111 ' ' Text.Whitespace
1112 'glob' Name
1113 '.' Punctuation
1114 'match' Name
1115 '(' Punctuation
1116 '"*.txt"' Literal.String.Double
1117 ',' Punctuation
1118 ' ' Text.Whitespace
1119 '[' Punctuation
1120 '"."' Literal.String.Double
1121 ']' Punctuation
1122 ',' Punctuation
1123 ' ' Text.Whitespace
1124 '"file.txt"' Literal.String.Double
1125 ')' Punctuation
1126 '\n' Text.Whitespace
1127
1128 ' ' Text.Whitespace
1129 'not' Keyword
1130 ' ' Text.Whitespace
1131 'glob' Name
1132 '.' Punctuation
1133 'match' Name
1134 '(' Punctuation
1135 '"*.txt"' Literal.String.Double
1136 ',' Punctuation
1137 ' ' Text.Whitespace
1138 '[' Punctuation
1139 '"."' Literal.String.Double
1140 ']' Punctuation
1141 ',' Punctuation
1142 ' ' Text.Whitespace
1143 '"file.jpg"' Literal.String.Double
1144 ')' Punctuation
1145 '\n' Text.Whitespace
1146
1147 '}' Punctuation
1148 '\n' Text.Whitespace
1149
1150 '\n' Text.Whitespace
1151
1152 '# Type checks' Comment.Single
1153 '\n' Text.Whitespace
1154
1155 'test_types' Name
1156 ' ' Text.Whitespace
1157 '{' Punctuation
1158 '\n' Text.Whitespace
1159
1160 ' ' Text.Whitespace
1161 'is_number' Name
1162 '(' Punctuation
1163 '5' Literal.Number
1164 ')' Punctuation
1165 '\n' Text.Whitespace
1166
1167 ' ' Text.Whitespace
1168 'is_string' Name
1169 '(' Punctuation
1170 '"abc"' Literal.String.Double
1171 ')' Punctuation
1172 '\n' Text.Whitespace
1173
1174 ' ' Text.Whitespace
1175 'is_boolean' Name
1176 '(' Punctuation
1177 'true' Keyword
1178 ')' Punctuation
1179 '\n' Text.Whitespace
1180
1181 ' ' Text.Whitespace
1182 'is_array' Name
1183 '(' Punctuation
1184 '[' Punctuation
1185 '1' Literal.Number
1186 ',' Punctuation
1187 ' ' Text.Whitespace
1188 '2' Literal.Number
1189 ',' Punctuation
1190 ' ' Text.Whitespace
1191 '3' Literal.Number
1192 ']' Punctuation
1193 ')' Punctuation
1194 '\n' Text.Whitespace
1195
1196 ' ' Text.Whitespace
1197 'is_set' Name
1198 '(' Punctuation
1199 '{' Punctuation
1200 '1' Literal.Number
1201 ',' Punctuation
1202 ' ' Text.Whitespace
1203 '2' Literal.Number
1204 ',' Punctuation
1205 ' ' Text.Whitespace
1206 '3' Literal.Number
1207 '}' Punctuation
1208 ')' Punctuation
1209 '\n' Text.Whitespace
1210
1211 ' ' Text.Whitespace
1212 'is_object' Name
1213 '(' Punctuation
1214 '{' Punctuation
1215 '"a"' Literal.String.Double
1216 ':' Punctuation
1217 ' ' Text.Whitespace
1218 '1' Literal.Number
1219 '}' Punctuation
1220 ')' Punctuation
1221 '\n' Text.Whitespace
1222
1223 ' ' Text.Whitespace
1224 'is_null' Name
1225 '(' Punctuation
1226 'null' Keyword
1227 ')' Punctuation
1228 '\n' Text.Whitespace
1229
1230 ' ' Text.Whitespace
1231 'type_name' Name
1232 '(' Punctuation
1233 '5' Literal.Number
1234 ')' Punctuation
1235 ' ' Text.Whitespace
1236 '==' Operator
1237 ' ' Text.Whitespace
1238 '"number"' Literal.String.Double
1239 '\n' Text.Whitespace
1240
1241 '}' Punctuation
1242 '\n' Text.Whitespace
1243
1244 '\n' Text.Whitespace
1245
1246 '# Encoding' Comment.Single
1247 '\n' Text.Whitespace
1248
1249 'test_encoding' Name
1250 ' ' Text.Whitespace
1251 '{' Punctuation
1252 '\n' Text.Whitespace
1253
1254 ' ' Text.Whitespace
1255 'base64' Name
1256 '.' Punctuation
1257 'encode' Name
1258 '(' Punctuation
1259 '"hello"' Literal.String.Double
1260 ')' Punctuation
1261 ' ' Text.Whitespace
1262 '==' Operator
1263 ' ' Text.Whitespace
1264 '"aGVsbG8="' Literal.String.Double
1265 '\n' Text.Whitespace
1266
1267 ' ' Text.Whitespace
1268 'base64' Name
1269 '.' Punctuation
1270 'decode' Name
1271 '(' Punctuation
1272 '"aGVsbG8="' Literal.String.Double
1273 ')' Punctuation
1274 ' ' Text.Whitespace
1275 '==' Operator
1276 ' ' Text.Whitespace
1277 '"hello"' Literal.String.Double
1278 '\n' Text.Whitespace
1279
1280 ' ' Text.Whitespace
1281 'json' Name
1282 '.' Punctuation
1283 'marshal' Name
1284 '(' Punctuation
1285 '{' Punctuation
1286 '"a"' Literal.String.Double
1287 ':' Punctuation
1288 ' ' Text.Whitespace
1289 '1' Literal.Number
1290 '}' Punctuation
1291 ')' Punctuation
1292 ' ' Text.Whitespace
1293 '==' Operator
1294 ' ' Text.Whitespace
1295 '"{\\"a\\":1}"' Literal.String.Double
1296 '\n' Text.Whitespace
1297
1298 ' ' Text.Whitespace
1299 'json' Name
1300 '.' Punctuation
1301 'unmarshal' Name
1302 '(' Punctuation
1303 '"{\\"a\\":1}"' Literal.String.Double
1304 ')' Punctuation
1305 ' ' Text.Whitespace
1306 '==' Operator
1307 ' ' Text.Whitespace
1308 '{' Punctuation
1309 '"a"' Literal.String.Double
1310 ':' Punctuation
1311 ' ' Text.Whitespace
1312 '1' Literal.Number
1313 '}' Punctuation
1314 '\n' Text.Whitespace
1315
1316 '}' Punctuation
1317 '\n' Text.Whitespace
1318
1319 '\n' Text.Whitespace
1320
1321 '# Time' Comment.Single
1322 '\n' Text.Whitespace
1323
1324 'test_time' Name
1325 ' ' Text.Whitespace
1326 '{' Punctuation
1327 '\n' Text.Whitespace
1328
1329 ' ' Text.Whitespace
1330 'time' Name
1331 '.' Punctuation
1332 'now_ns' Name
1333 '(' Punctuation
1334 ')' Punctuation
1335 ' ' Text.Whitespace
1336 '>' Operator
1337 ' ' Text.Whitespace
1338 '0' Literal.Number
1339 '\n' Text.Whitespace
1340
1341 ' ' Text.Whitespace
1342 'time' Name
1343 '.' Punctuation
1344 'parse_duration_ns' Name
1345 '(' Punctuation
1346 '"1h"' Literal.String.Double
1347 ')' Punctuation
1348 ' ' Text.Whitespace
1349 '==' Operator
1350 ' ' Text.Whitespace
1351 '3600000000000' Literal.Number
1352 '\n' Text.Whitespace
1353
1354 ' ' Text.Whitespace
1355 'parsed' Name
1356 ' ' Text.Whitespace
1357 ':=' Operator
1358 ' ' Text.Whitespace
1359 'time' Name
1360 '.' Punctuation
1361 'parse_rfc3339_ns' Name
1362 '(' Punctuation
1363 '"2006-01-02T15:04:05Z"' Literal.String.Double
1364 ')' Punctuation
1365 '\n' Text.Whitespace
1366
1367 ' ' Text.Whitespace
1368 '[' Punctuation
1369 'year' Name
1370 ',' Punctuation
1371 ' ' Text.Whitespace
1372 'month' Name
1373 ',' Punctuation
1374 ' ' Text.Whitespace
1375 'day' Name
1376 ']' Punctuation
1377 ' ' Text.Whitespace
1378 ':=' Operator
1379 ' ' Text.Whitespace
1380 'time' Name
1381 '.' Punctuation
1382 'date' Name
1383 '(' Punctuation
1384 'parsed' Name
1385 ')' Punctuation
1386 '\n' Text.Whitespace
1387
1388 ' ' Text.Whitespace
1389 'year' Name
1390 ' ' Text.Whitespace
1391 '==' Operator
1392 ' ' Text.Whitespace
1393 '2006' Literal.Number
1394 '\n' Text.Whitespace
1395
1396 ' ' Text.Whitespace
1397 'month' Name
1398 ' ' Text.Whitespace
1399 '==' Operator
1400 ' ' Text.Whitespace
1401 '1' Literal.Number
1402 '\n' Text.Whitespace
1403
1404 ' ' Text.Whitespace
1405 'day' Name
1406 ' ' Text.Whitespace
1407 '==' Operator
1408 ' ' Text.Whitespace
1409 '2' Literal.Number
1410 '\n' Text.Whitespace
1411
1412 '}' Punctuation
1413 '\n' Text.Whitespace
1414
1415 '\n' Text.Whitespace
1416
1417 '# Crypto' Comment.Single
1418 '\n' Text.Whitespace
1419
1420 'test_crypto' Name
1421 ' ' Text.Whitespace
1422 '{' Punctuation
1423 '\n' Text.Whitespace
1424
1425 ' ' Text.Whitespace
1426 'crypto' Name
1427 '.' Punctuation
1428 'md5' Name
1429 '(' Punctuation
1430 '"hello"' Literal.String.Double
1431 ')' Punctuation
1432 ' ' Text.Whitespace
1433 '==' Operator
1434 ' ' Text.Whitespace
1435 '"5d41402abc4b2a76b9719d911017c592"' Literal.String.Double
1436 '\n' Text.Whitespace
1437
1438 ' ' Text.Whitespace
1439 'crypto' Name
1440 '.' Punctuation
1441 'sha1' Name
1442 '(' Punctuation
1443 '"hello"' Literal.String.Double
1444 ')' Punctuation
1445 ' ' Text.Whitespace
1446 '==' Operator
1447 ' ' Text.Whitespace
1448 '"aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"' Literal.String.Double
1449 '\n' Text.Whitespace
1450
1451 ' ' Text.Whitespace
1452 'crypto' Name
1453 '.' Punctuation
1454 'sha256' Name
1455 '(' Punctuation
1456 '"hello"' Literal.String.Double
1457 ')' Punctuation
1458 ' ' Text.Whitespace
1459 '==' Operator
1460 ' ' Text.Whitespace
1461 '"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"' Literal.String.Double
1462 '\n' Text.Whitespace
1463
1464 '}' Punctuation
1465 '\n' Text.Whitespace
1466
1467 '\n' Text.Whitespace
1468
1469 '# Net' Comment.Single
1470 '\n' Text.Whitespace
1471
1472 'test_net' Name
1473 ' ' Text.Whitespace
1474 '{' Punctuation
1475 '\n' Text.Whitespace
1476
1477 ' ' Text.Whitespace
1478 'net' Name
1479 '.' Punctuation
1480 'cidr_contains' Name
1481 '(' Punctuation
1482 '"192.168.1.0/24"' Literal.String.Double
1483 ',' Punctuation
1484 ' ' Text.Whitespace
1485 '"192.168.1.100"' Literal.String.Double
1486 ')' Punctuation
1487 '\n' Text.Whitespace
1488
1489 ' ' Text.Whitespace
1490 'not' Keyword
1491 ' ' Text.Whitespace
1492 'net' Name
1493 '.' Punctuation
1494 'cidr_contains' Name
1495 '(' Punctuation
1496 '"192.168.1.0/24"' Literal.String.Double
1497 ',' Punctuation
1498 ' ' Text.Whitespace
1499 '"192.168.2.100"' Literal.String.Double
1500 ')' Punctuation
1501 '\n' Text.Whitespace
1502
1503 '}' Punctuation
1504 '\n' Text.Whitespace
1505
1506 '\n' Text.Whitespace
1507
1508 '# Graphs' Comment.Single
1509 '\n' Text.Whitespace
1510
1511 'test_graphs' Name
1512 ' ' Text.Whitespace
1513 '{' Punctuation
1514 '\n' Text.Whitespace
1515
1516 ' ' Text.Whitespace
1517 'graph' Name
1518 ' ' Text.Whitespace
1519 ':=' Operator
1520 ' ' Text.Whitespace
1521 '{' Punctuation
1522 '"a"' Literal.String.Double
1523 ':' Punctuation
1524 ' ' Text.Whitespace
1525 '[' Punctuation
1526 '"b"' Literal.String.Double
1527 ',' Punctuation
1528 ' ' Text.Whitespace
1529 '"c"' Literal.String.Double
1530 ']' Punctuation
1531 ',' Punctuation
1532 ' ' Text.Whitespace
1533 '"b"' Literal.String.Double
1534 ':' Punctuation
1535 ' ' Text.Whitespace
1536 '[' Punctuation
1537 '"d"' Literal.String.Double
1538 ']' Punctuation
1539 ',' Punctuation
1540 ' ' Text.Whitespace
1541 '"c"' Literal.String.Double
1542 ':' Punctuation
1543 ' ' Text.Whitespace
1544 '[' Punctuation
1545 '"d"' Literal.String.Double
1546 ']' Punctuation
1547 ',' Punctuation
1548 ' ' Text.Whitespace
1549 '"d"' Literal.String.Double
1550 ':' Punctuation
1551 ' ' Text.Whitespace
1552 '[' Punctuation
1553 ']' Punctuation
1554 '}' Punctuation
1555 '\n' Text.Whitespace
1556
1557 ' ' Text.Whitespace
1558 'graph' Name
1559 '.' Punctuation
1560 'reachable' Name
1561 '(' Punctuation
1562 'graph' Name
1563 ',' Punctuation
1564 ' ' Text.Whitespace
1565 '{' Punctuation
1566 '"a"' Literal.String.Double
1567 '}' Punctuation
1568 ')' Punctuation
1569 ' ' Text.Whitespace
1570 '==' Operator
1571 ' ' Text.Whitespace
1572 '{' Punctuation
1573 '"a"' Literal.String.Double
1574 ',' Punctuation
1575 ' ' Text.Whitespace
1576 '"b"' Literal.String.Double
1577 ',' Punctuation
1578 ' ' Text.Whitespace
1579 '"c"' Literal.String.Double
1580 ',' Punctuation
1581 ' ' Text.Whitespace
1582 '"d"' Literal.String.Double
1583 '}' Punctuation
1584 '\n' Text.Whitespace
1585
1586 '}' Punctuation
1587 '\n' Text.Whitespace
1588
1589 '\n' Text.Whitespace
1590
1591 '# HTTP and JWTs (mocked)' Comment.Single
1592 '\n' Text.Whitespace
1593
1594 'mock_http_send' Name
1595 '(' Punctuation
1596 'request' Name
1597 ')' Punctuation
1598 ' ' Text.Whitespace
1599 '=' Operator
1600 ' ' Text.Whitespace
1601 'http_response' Name
1602 ' ' Text.Whitespace
1603 'if' Keyword
1604 ' ' Text.Whitespace
1605 '{' Punctuation
1606 '\n' Text.Whitespace
1607
1608 ' ' Text.Whitespace
1609 'request' Name
1610 '.' Punctuation
1611 'url' Name
1612 ' ' Text.Whitespace
1613 '==' Operator
1614 ' ' Text.Whitespace
1615 '"https://example.com"' Literal.String.Double
1616 '\n' Text.Whitespace
1617
1618 ' ' Text.Whitespace
1619 'http_response' Name
1620 ' ' Text.Whitespace
1621 ':=' Operator
1622 ' ' Text.Whitespace
1623 '{' Punctuation
1624 '\n' Text.Whitespace
1625
1626 ' ' Text.Whitespace
1627 '"status"' Literal.String.Double
1628 ':' Punctuation
1629 ' ' Text.Whitespace
1630 '"200 OK"' Literal.String.Double
1631 ',' Punctuation
1632 '\n' Text.Whitespace
1633
1634 ' ' Text.Whitespace
1635 '"status_code"' Literal.String.Double
1636 ':' Punctuation
1637 ' ' Text.Whitespace
1638 '200' Literal.Number
1639 ',' Punctuation
1640 '\n' Text.Whitespace
1641
1642 ' ' Text.Whitespace
1643 '"body"' Literal.String.Double
1644 ':' Punctuation
1645 ' ' Text.Whitespace
1646 '"{\\"key\\": \\"value\\"}"' Literal.String.Double
1647 ',' Punctuation
1648 '\n' Text.Whitespace
1649
1650 ' ' Text.Whitespace
1651 '}' Punctuation
1652 '\n' Text.Whitespace
1653
1654 '}' Punctuation
1655 '\n' Text.Whitespace
1656
1657 '\n' Text.Whitespace
1658
1659 'test_http_and_jwt' Name
1660 ' ' Text.Whitespace
1661 '{' Punctuation
1662 '\n' Text.Whitespace
1663
1664 ' ' Text.Whitespace
1665 'http' Name
1666 '.' Punctuation
1667 'send' Name
1668 '(' Punctuation
1669 '{' Punctuation
1670 '"method"' Literal.String.Double
1671 ':' Punctuation
1672 ' ' Text.Whitespace
1673 '"GET"' Literal.String.Double
1674 ',' Punctuation
1675 ' ' Text.Whitespace
1676 '"url"' Literal.String.Double
1677 ':' Punctuation
1678 ' ' Text.Whitespace
1679 '"https://example.com"' Literal.String.Double
1680 '}' Punctuation
1681 ')' Punctuation
1682 ' ' Text.Whitespace
1683 '==' Operator
1684 ' ' Text.Whitespace
1685 'mock_http_send' Name
1686 '(' Punctuation
1687 '{' Punctuation
1688 '"method"' Literal.String.Double
1689 ':' Punctuation
1690 ' ' Text.Whitespace
1691 '"GET"' Literal.String.Double
1692 ',' Punctuation
1693 ' ' Text.Whitespace
1694 '"url"' Literal.String.Double
1695 ':' Punctuation
1696 ' ' Text.Whitespace
1697 '"https://example.com"' Literal.String.Double
1698 '}' Punctuation
1699 ')' Punctuation
1700 '\n' Text.Whitespace
1701
1702 ' ' Text.Whitespace
1703 'io' Name
1704 '.' Punctuation
1705 'jwt' Name
1706 '.' Punctuation
1707 'encode_sign' Name
1708 '(' Punctuation
1709 '{' Punctuation
1710 '"alg"' Literal.String.Double
1711 ':' Punctuation
1712 ' ' Text.Whitespace
1713 '"HS256"' Literal.String.Double
1714 '}' Punctuation
1715 ',' Punctuation
1716 ' ' Text.Whitespace
1717 '{' Punctuation
1718 '"sub"' Literal.String.Double
1719 ':' Punctuation
1720 ' ' Text.Whitespace
1721 '"1234567890"' Literal.String.Double
1722 '}' Punctuation
1723 ',' Punctuation
1724 ' ' Text.Whitespace
1725 '{' Punctuation
1726 '"kty"' Literal.String.Double
1727 ':' Punctuation
1728 ' ' Text.Whitespace
1729 '"oct"' Literal.String.Double
1730 ',' Punctuation
1731 ' ' Text.Whitespace
1732 '"k"' Literal.String.Double
1733 ':' Punctuation
1734 ' ' Text.Whitespace
1735 '"secret"' Literal.String.Double
1736 '}' Punctuation
1737 ')' Punctuation
1738 '\n' Text.Whitespace
1739
1740 '}' Punctuation
1741 '\n' Text.Whitespace
1742
1743 '\n' Text.Whitespace
1744
1745 '# UUID' Comment.Single
1746 '\n' Text.Whitespace
1747
1748 'test_uuid' Name
1749 ' ' Text.Whitespace
1750 '{' Punctuation
1751 '\n' Text.Whitespace
1752
1753 ' ' Text.Whitespace
1754 'uuid' Name
1755 ' ' Text.Whitespace
1756 ':=' Operator
1757 ' ' Text.Whitespace
1758 'uuid' Name
1759 '.' Punctuation
1760 'rfc4122' Name
1761 '(' Punctuation
1762 '"test"' Literal.String.Double
1763 ')' Punctuation
1764 '\n' Text.Whitespace
1765
1766 ' ' Text.Whitespace
1767 'startswith' Name
1768 '(' Punctuation
1769 'uuid' Name
1770 ',' Punctuation
1771 ' ' Text.Whitespace
1772 '""' Literal.String.Double
1773 ')' Punctuation
1774 ' ' Text.Whitespace
1775 '# Always true, just to use the uuid variable' Comment.Single
1776 '\n' Text.Whitespace
1777
1778 ' ' Text.Whitespace
1779 'uuid2' Name
1780 ' ' Text.Whitespace
1781 ':=' Operator
1782 ' ' Text.Whitespace
1783 'uuid' Name
1784 '.' Punctuation
1785 'rfc4122' Name
1786 '(' Punctuation
1787 '"test"' Literal.String.Double
1788 ')' Punctuation
1789 '\n' Text.Whitespace
1790
1791 ' ' Text.Whitespace
1792 'uuid' Name
1793 ' ' Text.Whitespace
1794 '==' Operator
1795 ' ' Text.Whitespace
1796 'uuid2' Name
1797 ' ' Text.Whitespace
1798 '# Consistent for the same input' Comment.Single
1799 '\n' Text.Whitespace
1800
1801 '}' Punctuation
1802 '\n' Text.Whitespace
1803
1804 '\n' Text.Whitespace
1805
1806 '# Rego' Comment.Single
1807 '\n' Text.Whitespace
1808
1809 'test_rego' Name
1810 ' ' Text.Whitespace
1811 '{' Punctuation
1812 '\n' Text.Whitespace
1813
1814 ' ' Text.Whitespace
1815 'parsed' Name
1816 ' ' Text.Whitespace
1817 ':=' Operator
1818 ' ' Text.Whitespace
1819 'rego' Name
1820 '.' Punctuation
1821 'parse_module' Name
1822 '(' Punctuation
1823 '"test.rego"' Literal.String.Double
1824 ',' Punctuation
1825 ' ' Text.Whitespace
1826 '"package test"' Literal.String.Double
1827 ')' Punctuation
1828 '\n' Text.Whitespace
1829
1830 ' ' Text.Whitespace
1831 'parsed' Name
1832 '.' Punctuation
1833 'package' Keyword
1834 '.' Punctuation
1835 'path' Name
1836 '[' Punctuation
1837 '0' Literal.Number
1838 ']' Punctuation
1839 '.' Punctuation
1840 'value' Name
1841 ' ' Text.Whitespace
1842 '==' Operator
1843 ' ' Text.Whitespace
1844 '"test"' Literal.String.Double
1845 '\n' Text.Whitespace
1846
1847 '}' Punctuation
1848 '\n' Text.Whitespace
1849
1850 '\n' Text.Whitespace
1851
1852 '# OPA Runtime' Comment.Single
1853 '\n' Text.Whitespace
1854
1855 'test_opa_runtime' Name
1856 ' ' Text.Whitespace
1857 '{' Punctuation
1858 '\n' Text.Whitespace
1859
1860 ' ' Text.Whitespace
1861 'runtime' Name
1862 ' ' Text.Whitespace
1863 ':=' Operator
1864 ' ' Text.Whitespace
1865 'opa' Name
1866 '.' Punctuation
1867 'runtime' Name
1868 '(' Punctuation
1869 ')' Punctuation
1870 '\n' Text.Whitespace
1871
1872 ' ' Text.Whitespace
1873 'is_object' Name
1874 '(' Punctuation
1875 'runtime' Name
1876 ')' Punctuation
1877 '\n' Text.Whitespace
1878
1879 '}' Punctuation
1880 '\n' Text.Whitespace