Merge lp:~zorba-coders/zorba/bug-1188062 into lp:zorba/queue-module

Proposed by Luis Rodriguez Gonzalez
Status: Merged
Approved by: Luis Rodriguez Gonzalez
Approved revision: 19
Merged at revision: 14
Proposed branch: lp:~zorba-coders/zorba/bug-1188062
Merge into: lp:zorba/queue-module
Diff against target: 546 lines (+181/-72)
29 files modified
src/CMakeLists.txt (+1/-1)
src/queue.xq (+60/-58)
test/ExpQueryResults/back-json1.xml.res (+1/-0)
test/ExpQueryResults/copy-json1.xml.res (+1/-0)
test/ExpQueryResults/empty-json1.xml.res (+2/-0)
test/ExpQueryResults/front-json1.xml.res (+1/-0)
test/ExpQueryResults/pop-json2.xml.res (+1/-0)
test/ExpQueryResults/pop-mix.xml.res (+1/-0)
test/ExpQueryResults/push-json1.xml.res (+1/-0)
test/ExpQueryResults/push-json2.xml.res (+1/-0)
test/ExpQueryResults/size-json1.xml.res (+2/-0)
test/Queries/back-json1.xq (+7/-0)
test/Queries/back1.xq (+2/-2)
test/Queries/copy-json1.xq (+11/-0)
test/Queries/copy1.xq (+1/-1)
test/Queries/empty-json1.xq (+20/-0)
test/Queries/empty1.xq (+1/-1)
test/Queries/front-json1.xq (+7/-0)
test/Queries/front1.xq (+2/-2)
test/Queries/pop-json2.xq (+7/-0)
test/Queries/pop-mix.xq (+9/-0)
test/Queries/pop1.xq (+2/-2)
test/Queries/pop2.xq (+2/-2)
test/Queries/push-json1.xq (+12/-0)
test/Queries/push-json2.xq (+13/-0)
test/Queries/push1.xq (+1/-1)
test/Queries/push2.xq (+1/-1)
test/Queries/size-json1.xq (+10/-0)
test/Queries/size1.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1188062
Reviewer Review Type Date Requested Status
Luis Rodriguez Gonzalez Approve
Chris Hillery Approve
Review via email: mp+169946@code.launchpad.net

Commit message

Update to 3.0 module guidelines; make JSON-ready.

Description of the change

To post a comment you must log in.
Revision history for this message
Chris Hillery (ceejatec) wrote :

See the updated task description on the bug report. Also, see the updated coding guidelines for <p> and error codes.

review: Needs Fixing
lp:~zorba-coders/zorba/bug-1188062 updated
14. By Luis Rodriguez Gonzalez

added the ability to manage JSON structures and a new test case

15. By Luis Rodriguez Gonzalez

Changes to fix actual problems

Revision history for this message
Luis Rodriguez Gonzalez (kuraru) wrote :

> See the updated task description on the bug report. Also, see the updated
> coding guidelines for <p> and error codes.

Documentation and code problems fixed, please check it again.

lp:~zorba-coders/zorba/bug-1188062 updated
16. By Luis Rodriguez Gonzalez

Forgot to add the new testcases

Revision history for this message
Chris Hillery (ceejatec) wrote :

1. Error QNames should not be declared as public constants (see coding guidelines). Declare them as private variables as follows:

declare %private variable $queue:NOT-EXISTS as xs:QName := fn:QName($queue:ERR-NS, "queue:NOT-EXISTS");

2. The current XQDoc for those error QNames is pointless. Either eliminate the XQDoc entirely, or put in some meaningful comment (only for later authors of the module since it won't be part of the public API).

3. The XQDoc for all the queue functions refers to "nodes". It should now say "items" since it works for objects and arrays in addition to nodes.

review: Needs Fixing
lp:~zorba-coders/zorba/bug-1188062 updated
17. By Luis Rodriguez Gonzalez

Constants declared as private. Removed comments for private variables.

18. By Luis Rodriguez Gonzalez

All references to nodes were changed to items.

19. By Chris Hillery

Updated header comment.

Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Luis Rodriguez Gonzalez (kuraru) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1188062/+merge/169946

Stage "TestZorbaUbuntu" failed.
4 tests failed (8355 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/86/testReport/ to view the results.

lp:~zorba-coders/zorba/bug-1188062 updated
20. By Chris Hillery

Updating error URI.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1188062/+merge/169946

Stage "TestZorbaUbuntu" failed.
2 tests failed (8355 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/87/testReport/ to view the results.

lp:~zorba-coders/zorba/bug-1188062 updated
21. By Chris Hillery

Updated test results.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2012-02-29 09:08:58 +0000
+++ src/CMakeLists.txt 2013-07-17 06:14:23 +0000
@@ -15,6 +15,6 @@
1515
16##### Queue data structure16##### Queue data structure
1717
18DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/store/data-structures/queue" VERSION 1.0 FILE "queue.xq")18DECLARE_ZORBA_MODULE (URI "http://zorba.io/modules/queue" VERSION 1.0 FILE "queue.xq")
1919
20ADD_TEST_DIRECTORY("${PROJECT_SOURCE_DIR}/test")20ADD_TEST_DIRECTORY("${PROJECT_SOURCE_DIR}/test")
2121
=== modified file 'src/queue.xq'
--- src/queue.xq 2013-06-15 19:46:41 +0000
+++ src/queue.xq 2013-07-17 06:14:23 +0000
@@ -17,12 +17,15 @@
17:)17:)
1818
19(:~19(:~
20 : Implementation of queue for node items, using dynamic collections.<br />20 : Implementation of queue for items, using dynamic collections.<p/>
21 :
22 : Entries in the queue must be structured items - that is, either JSON
23 : Objects or Arrays, or XML Nodes. <p/>
21 :24 :
22 : @author Daniel Turcanu, Sorin Nasoi25 : @author Daniel Turcanu, Sorin Nasoi
23 : @project Zorba/Data Store/Data Structures/Queue26 : @project Zorba/Data Store/Data Structures/Queue
24 :)27 :)
25module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";28module namespace queue = "http://zorba.io/modules/queue";
2629
27import module namespace collections-ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";30import module namespace collections-ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
28import module namespace collections-dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";31import module namespace collections-dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
@@ -31,137 +34,136 @@
31declare namespace ver = "http://www.zorba-xquery.com/options/versioning";34declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
32declare option ver:module-version "1.0";35declare option ver:module-version "1.0";
3336
34(:~37declare %private variable $queue:ERR-NS as xs:string := "http://zorba.io/modules/queue";
35 : Errors namespace URI.
36:)
37declare variable $queue:errNS as xs:string := "http://www.zorba-xquery.com/modules/store/data-structures/queue";
38 38
39(:~39declare %private variable $queue:NOT-EXISTS as xs:QName := fn:QName($queue:ERR-NS, "queue:NOT-EXISTS");
40 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/store/data-structures/queue" and local name "errNA"40
41:)41declare %private variable $queue:EXISTS as xs:QName := fn:QName($queue:ERR-NS, "queue:EXISTS");
42declare variable $queue:errNA as xs:QName := fn:QName($queue:errNS, "queue:errNA");42
4343(:~
44(:~44 : Create a queue with the name given. If a queue with the given name already exists, an error is raised. <p/>
45 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/store/data-structures/queue" and local name "errExists"45 :
46:)
47declare variable $queue:errExists as xs:QName := fn:QName($queue:errNS, "queue:errExists");
48
49(:~
50 : Create a queue with this name. <br /> If queue exists, an error is raised.
51 : @param $name name of the new queue.46 : @param $name name of the new queue.
52 : @return ()47 : @return an empty sequence.
53 : @error queue:errExists if the queue identified by $name already exists.48 : @error queue:EXISTS if the queue identified by $name already exists.
54 :)49 :)
55declare %ann:sequential function queue:create($name as xs:QName) as empty-sequence()50declare %ann:sequential function queue:create($name as xs:QName) as empty-sequence()
56{51{
57 if(collections-ddl:is-available-collection($name)) then52 if(collections-ddl:is-available-collection($name)) then
58 fn:error($queue:errExists, "Queue already exists.");53 fn:error($queue:EXISTS, "Queue already exists.");
59 else54 else
60 collections-ddl:create($name);55 collections-ddl:create($name);
61};56};
6257
63(:~58(:~
64 : Return the first node in the queue (the first added), without removing it.59 : Return the first item in the queue (the first added), without removing it. <p/>
60 :
65 : @param $name name of the queue.61 : @param $name name of the queue.
66 : @return the first node, or empty sequence if queue is empty.62 : @return the first item, or empty sequence if queue is empty.
67 : @example test/Queries/front1.xq63 : @example test/Queries/front1.xq
68 : @error queue:errNA if the queue identified by $name does not exist.64 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
69 :)65 :)
70declare function queue:front($name as xs:QName) as node()?66declare function queue:front($name as xs:QName) as structured-item()?
71{67{
72 if(not(collections-ddl:is-available-collection($name))) then68 if(not(collections-ddl:is-available-collection($name))) then
73 fn:error($queue:errNA, "Queue does not exist.")69 fn:error($queue:NOT-EXISTS, "Queue does not exist.")
74 else70 else
75 collections-dml:collection($name)[1]71 collections-dml:collection($name)[1]
76};72};
7773
78(:~74(:~
79 : Return the last node in the queue (the last added), without removing it.75 : Return the last item in the queue (the last added), without removing it. <p/>
76 :
80 : @param $name name of the queue.77 : @param $name name of the queue.
81 : @return the last node, or empty sequence if queue is empty.78 : @return the last item, or empty sequence if queue is empty.
82 : @example test/Queries/back1.xq79 : @example test/Queries/back1.xq
83 : @error queue:errNA if the queue identified by $name does not exist.80 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
84 :)81 :)
85declare function queue:back($name as xs:QName) as node()?82declare function queue:back($name as xs:QName) as structured-item()?
86{83{
87 if(not(collections-ddl:is-available-collection($name))) then84 if(not(collections-ddl:is-available-collection($name))) then
88 fn:error($queue:errNA, "Queue does not exist.")85 fn:error($queue:NOT-EXISTS, "Queue does not exist.")
89 else86 else
90 collections-dml:collection($name)[fn:last()]87 collections-dml:collection($name)[fn:last()]
91};88};
9289
93(:~90(:~
94 : Return the first node in the queue, and remove it.91 : Return the first item in the queue, and remove it. <p/>
92 :
95 : @param $name name of the queue.93 : @param $name name of the queue.
96 : @return the first node, or empty sequence if queue is empty.94 : @return the first item, or empty sequence if queue is empty.
97 : @example test/Queries/pop2.xq95 : @example test/Queries/pop2.xq
98 : @error queue:errNA if the queue identified by $name does not exist.96 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
99 :)97 :)
100declare %ann:sequential function queue:pop($name as xs:QName) as node()?98declare %ann:sequential function queue:pop($name as xs:QName) as structured-item()?
101{99{
102 if(not(collections-ddl:is-available-collection($name))) then100 if(not(collections-ddl:is-available-collection($name))) then
103 fn:error($queue:errNA, "Queue does not exist.")101 fn:error($queue:NOT-EXISTS, "Queue does not exist.")
104 else102 else
105 {103 {
106 variable $topNode := collections-dml:collection($name)[1];104 variable $topItem := collections-dml:collection($name)[1];
107 collections-dml:delete-node-first($name);105 collections-dml:delete-first($name);
108 $topNode106 $topItem
109 }107 }
110};108};
111109
112(:~110(:~
113 : Add a new node to the queue; the queue will contain a copy of the given node.111 : Add a new item to the queue; the queue will contain a copy of the given item. <p/>
112 :
114 : @param $name name of the queue.113 : @param $name name of the queue.
115 : @param $value the node to be added.114 : @param $value the item to be added.
116 : @return ()115 : @return ()
117 : @example test/Queries/push1.xq116 : @example test/Queries/push1.xq
118 : @error queue:errNA if the queue identified by $name does not exist.117 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
119 :)118 :)
120declare %ann:sequential function queue:push($name as xs:QName, $value as node()) as empty-sequence()119declare %ann:sequential function queue:push($name as xs:QName, $value as structured-item()) as empty-sequence()
121{120{
122 if(not(collections-ddl:is-available-collection($name))) then121 if(not(collections-ddl:is-available-collection($name))) then
123 fn:error($queue:errNA, "Queue does not exist.");122 fn:error($queue:NOT-EXISTS, "Queue does not exist.");
124 else123 else
125 collections-dml:apply-insert-nodes-last($name, $value);124 collections-dml:apply-insert-last($name, $value);
126};125};
127126
128(:~127(:~
129 : Checks if a queue exists and is empty.128 : Checks if a queue exists and is empty. <p/>
129 :
130 : @param $name name of the queue.130 : @param $name name of the queue.
131 : @return true is the queue is empty or does not exist.131 : @return true is the queue is empty, false if it is not empty.
132 : @example test/Queries/empty1.xq132 : @example test/Queries/empty1.xq
133 : @error queue:errNA if the queue identified by $name does not exist.133 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
134 :)134 :)
135declare function queue:empty($name as xs:QName) as xs:boolean135declare function queue:empty($name as xs:QName) as xs:boolean
136{136{
137 if(not(collections-ddl:is-available-collection($name))) then137 if(not(collections-ddl:is-available-collection($name))) then
138 fn:error($queue:errNA, "Queue does not exist.")138 fn:error($queue:NOT-EXISTS, "Queue does not exist.")
139 else139 else
140 fn:empty(collections-dml:collection($name))140 fn:empty(collections-dml:collection($name))
141};141};
142142
143(:~143(:~
144 : Count of nodes in the queue.144 : Count of items in the queue. <p/>
145 :
145 : @param $name name of the queue.146 : @param $name name of the queue.
146 : @return the count of nodes.147 : @return the count of items.
147 : @example test/Queries/size1.xq148 : @example test/Queries/size1.xq
148 : @error queue:errNA if the queue identified by $name does not exist.149 : @error queue:NOT-EXISTS if the queue identified by $name does not exist.
149 :)150 :)
150declare function queue:size($name as xs:QName) as xs:integer151declare function queue:size($name as xs:QName) as xs:integer
151{152{
152 if(not(collections-ddl:is-available-collection($name))) then153 if(not(collections-ddl:is-available-collection($name))) then
153 fn:error($queue:errNA, "Queue does not exist.")154 fn:error($queue:NOT-EXISTS, "Queue does not exist.")
154 else155 else
155 fn:count(collections-dml:collection($name))156 fn:count(collections-dml:collection($name))
156};157};
157158
158(:~159(:~
159 : Copy all nodes from source queue to a destination queue.<br />160 : Copy all items from source queue to a destination queue. <p/>
160 : If destination queue does not exist, it is created first. <br />161 : If destination queue does not exist, it is created first. <p/>
161 : If destination queue is not empty, the nodes are appended last.162 : If destination queue is not empty, the items are appended last. <p/>
163 :
162 : @param $destName name of the destination queue.164 : @param $destName name of the destination queue.
163 : @param $sourceName name of the source queue.165 : @param $sourceName name of the source queue.
164 : @return ()166 : @return an empty sequence.
165 : @example test/Queries/copy1.xq167 : @example test/Queries/copy1.xq
166 :)168 :)
167declare %ann:sequential function queue:copy($destName as xs:QName, $sourceName as xs:QName) as empty-sequence()169declare %ann:sequential function queue:copy($destName as xs:QName, $sourceName as xs:QName) as empty-sequence()
@@ -170,5 +172,5 @@
170 collections-ddl:create($destName);172 collections-ddl:create($destName);
171 else173 else
172 ();174 ();
173 collections-dml:insert-nodes-last($destName, collections-dml:collection($sourceName));175 collections-dml:insert-last($destName, collections-dml:collection($sourceName));
174};176};
175177
=== added file 'test/ExpQueryResults/back-json1.xml.res'
--- test/ExpQueryResults/back-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/back-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "b" : 2 }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/copy-json1.xml.res'
--- test/ExpQueryResults/copy-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/copy-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "a" : 1 }4
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/empty-json1.xml.res'
--- test/ExpQueryResults/empty-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/empty-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2false{ "a" : 1 }{ "b" : null }true
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/ExpQueryResults/front-json1.xml.res'
--- test/ExpQueryResults/front-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/front-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "a" : 1 }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/pop-json2.xml.res'
--- test/ExpQueryResults/pop-json2.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/pop-json2.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "pi" : 3.1415927 }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/pop-mix.xml.res'
--- test/ExpQueryResults/pop-mix.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/pop-mix.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "pi" : 3.1415927 }{ "e" : 2.7182818 }<a/><b/>
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/push-json1.xml.res'
--- test/ExpQueryResults/push-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/push-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "a" : 1 }{ "b" : true }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/push-json2.xml.res'
--- test/ExpQueryResults/push-json2.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/push-json2.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,1 @@
1{ "a" : 1 }{ "b" : 2.1 }{ "c" : "done" }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/size-json1.xml.res'
--- test/ExpQueryResults/size-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/size-json1.xml.res 2013-07-17 06:14:23 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
23
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/Queries/back-json1.xq'
--- test/Queries/back-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/back-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,7 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4queue:create($name);
5queue:push($name, {"a" : 1});
6queue:push($name, {"b" : 2});
7queue:back($name)
08
=== modified file 'test/Queries/back1.xq'
--- test/Queries/back1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/back1.xq 2013-07-17 06:14:23 +0000
@@ -1,7 +1,7 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4queue:create($name);4queue:create($name);
5queue:push($name, <a/>);5queue:push($name, <a/>);
6queue:push($name, <b/>);6queue:push($name, <b/>);
7queue:back($name)
8\ No newline at end of file7\ No newline at end of file
8queue:back($name)
99
=== added file 'test/Queries/copy-json1.xq'
--- test/Queries/copy-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/copy-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,11 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4variable $nameCopy := fn:QName("", "queue-copy");
5queue:create($name);
6queue:push($name, { "a" : 1 });
7queue:push($name, { "b" : "hi" });
8queue:copy($nameCopy, $name);
9queue:push($nameCopy, { "c" : jn:null() });
10queue:push($nameCopy, { "d" : fn:true() });
11(queue:front($nameCopy), queue:size($nameCopy))
012
=== modified file 'test/Queries/copy1.xq'
--- test/Queries/copy1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/copy1.xq 2013-07-17 06:14:23 +0000
@@ -1,4 +1,4 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4variable $nameCopy := fn:QName("", "queue-copy");4variable $nameCopy := fn:QName("", "queue-copy");
55
=== added file 'test/Queries/empty-json1.xq'
--- test/Queries/empty-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/empty-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,20 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2import module namespace collections-ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
3import module namespace collections-dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
4
5variable $name := fn:QName("", "queue1");
6
7(
8 queue:create($name),
9 queue:push($name, { "a" : 1 }),
10 queue:push($name, { "b" : jn:null() }),
11 queue:empty($name),
12 queue:pop($name),
13 queue:pop($name),
14 queue:empty($name),
15 {
16 collections-dml:delete-first($name, queue:size($name));
17 collections-ddl:delete($name);
18 ()
19 }
20)
021
=== modified file 'test/Queries/empty1.xq'
--- test/Queries/empty1.xq 2012-04-18 09:42:23 +0000
+++ test/Queries/empty1.xq 2013-07-17 06:14:23 +0000
@@ -1,4 +1,4 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
2import module namespace collections-ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";2import module namespace collections-ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
3import module namespace collections-dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";3import module namespace collections-dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
44
55
=== added file 'test/Queries/front-json1.xq'
--- test/Queries/front-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/front-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,7 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4queue:create($name);
5queue:push($name, { "a" : 1 });
6queue:push($name, { "b" : fn:false() });
7queue:front($name)
08
=== modified file 'test/Queries/front1.xq'
--- test/Queries/front1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/front1.xq 2013-07-17 06:14:23 +0000
@@ -1,7 +1,7 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4queue:create($name);4queue:create($name);
5queue:push($name, <a/>);5queue:push($name, <a/>);
6queue:push($name, <b/>);6queue:push($name, <b/>);
7queue:front($name)
8\ No newline at end of file7\ No newline at end of file
8queue:front($name)
99
=== added file 'test/Queries/pop-json2.xq'
--- test/Queries/pop-json2.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/pop-json2.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,7 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4queue:create($name);
5queue:push($name, { "pi" : 3.1415927 });
6queue:push($name, { "e" : 2.7182818 });
7queue:pop($name)
08
=== added file 'test/Queries/pop-mix.xq'
--- test/Queries/pop-mix.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/pop-mix.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,9 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4queue:create($name);
5queue:push($name, { "pi" : 3.1415927 });
6queue:push($name, { "e" : 2.7182818 });
7queue:push($name, <a/>);
8queue:push($name, <b/>);
9(queue:pop($name), queue:pop($name), queue:pop($name), queue:pop($name))
010
=== modified file 'test/Queries/pop1.xq'
--- test/Queries/pop1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/pop1.xq 2013-07-17 06:14:23 +0000
@@ -1,5 +1,5 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4queue:create($name);4queue:create($name);
5queue:pop($name)
6\ No newline at end of file5\ No newline at end of file
6queue:pop($name)
77
=== modified file 'test/Queries/pop2.xq'
--- test/Queries/pop2.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/pop2.xq 2013-07-17 06:14:23 +0000
@@ -1,7 +1,7 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4queue:create($name);4queue:create($name);
5queue:push($name, <a/>);5queue:push($name, <a/>);
6queue:push($name, <b/>);6queue:push($name, <b/>);
7queue:pop($name)
8\ No newline at end of file7\ No newline at end of file
8queue:pop($name)
99
=== added file 'test/Queries/push-json1.xq'
--- test/Queries/push-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/push-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,12 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4(
5 queue:create($name),
6 queue:push($name, { "a" : 1 }),
7 queue:push($name, { "b" : fn:true() }),
8 queue:pop($name),
9 queue:push($name, { "c" : jn:null() }),
10 queue:push($name, { "d" : 1.4142 }),
11 queue:pop($name)
12)
013
=== added file 'test/Queries/push-json2.xq'
--- test/Queries/push-json2.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/push-json2.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,13 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4(
5 queue:create($name),
6 queue:push($name, { "a" : 1 }),
7 queue:push($name, { "b" : 2.1 }),
8 queue:pop($name),
9 queue:push($name, { "c" : "done" }),
10 queue:push($name, { "d" : jn:null() }),
11 queue:pop($name),
12 queue:pop($name)
13)
014
=== modified file 'test/Queries/push1.xq'
--- test/Queries/push1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/push1.xq 2013-07-17 06:14:23 +0000
@@ -1,4 +1,4 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4(4(
55
=== modified file 'test/Queries/push2.xq'
--- test/Queries/push2.xq 2012-03-23 07:19:21 +0000
+++ test/Queries/push2.xq 2013-07-17 06:14:23 +0000
@@ -1,4 +1,4 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4(4(
55
=== added file 'test/Queries/size-json1.xq'
--- test/Queries/size-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/size-json1.xq 2013-07-17 06:14:23 +0000
@@ -0,0 +1,10 @@
1import module namespace queue = "http://zorba.io/modules/queue";
2
3variable $name := fn:QName("", "queue1");
4queue:create($name);
5queue:push($name, { "a" : 1 });
6queue:push($name, { "b" : 2.1 });
7queue:pop($name);
8queue:push($name, { "c" : fn:false() });
9queue:push($name, { "d" : "sort" });
10queue:size($name)
011
=== modified file 'test/Queries/size1.xq'
--- test/Queries/size1.xq 2012-02-29 09:08:58 +0000
+++ test/Queries/size1.xq 2013-07-17 06:14:23 +0000
@@ -1,4 +1,4 @@
1import module namespace queue = "http://www.zorba-xquery.com/modules/store/data-structures/queue";1import module namespace queue = "http://zorba.io/modules/queue";
22
3variable $name := fn:QName("", "queue1");3variable $name := fn:QName("", "queue1");
4queue:create($name);4queue:create($name);

Subscribers

People subscribed via source and target branches

to all changes: