Merge lp:~zorba-coders/zorba/bug-1188061 into lp:zorba/stack-module

Proposed by Luis Rodriguez Gonzalez
Status: Merged
Approved by: Luis Rodriguez Gonzalez
Approved revision: 22
Merged at revision: 15
Proposed branch: lp:~zorba-coders/zorba/bug-1188061
Merge into: lp:zorba/stack-module
Diff against target: 474 lines (+161/-70)
26 files modified
src/CMakeLists.txt (+1/-1)
src/stack.xq (+62/-61)
test/ExpQueryResults/copy-json1.xml.res (+1/-0)
test/ExpQueryResults/copy-mix.xml.res (+1/-0)
test/ExpQueryResults/create-json1.xml.res (+1/-0)
test/ExpQueryResults/empty-json1.xml.res (+1/-0)
test/ExpQueryResults/pop-json2.xml.res (+1/-0)
test/ExpQueryResults/push-json1.xml.res (+1/-0)
test/ExpQueryResults/size-json1.xml.res (+2/-0)
test/ExpQueryResults/top-json1.xml.res (+1/-0)
test/Queries/copy-json1.xq (+11/-0)
test/Queries/copy-mix.xq (+11/-0)
test/Queries/copy1.xq (+1/-1)
test/Queries/create-json1.xq (+9/-0)
test/Queries/create1.xq (+1/-1)
test/Queries/empty-json1.xq (+12/-0)
test/Queries/empty1.xq (+1/-1)
test/Queries/pop-json2.xq (+7/-0)
test/Queries/pop1.xq (+1/-1)
test/Queries/pop2.xq (+1/-1)
test/Queries/push-json1.xq (+6/-0)
test/Queries/push1.xq (+1/-1)
test/Queries/size-json1.xq (+13/-0)
test/Queries/size1.xq (+1/-1)
test/Queries/top-json1.xq (+12/-0)
test/Queries/top1.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1188061
Reviewer Review Type Date Requested Status
Juan Zacarias Approve
Luis Rodriguez Gonzalez Approve
Chris Hillery Approve
Review via email: mp+169553@code.launchpad.net

Commit message

Update to 3.0 module guidelines; make JSON-ready.

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

Looks pretty good so far! A couple questions for Matthias since he wrote the style guide:

1. Is this the correct way to use <p> for splitting doc paragraphs - wrapping them in <p>...</p> ? Or should there be single <p /> elements between paragraphs?

2. Is this the correct way to refer to error codes? I think there's supposed to be an actual module constant for each code, right? And then @error should list the constant?

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

Also, Luis: Have you done any investigation to ensure that the documentation is reasonable? In particular is the header comment clear, clean, and possibly have an example or two?

And, can you verify that all reasonably-possible error conditions are documented? At least, are there any other XQuery error codes thrown by the module functions (or from the module C++ code, if any)?

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

The documentation has several mentions to tests that are included but no
textual representations are made, Should I move some of the examples to the
code instead of sending the user to check the tests?
Aside from that the documentation seems to be pretty straight forward and
all the errors that I can think for each case seems to be covered.

Thanks,
Luis.

2013/6/14 Chris Hillery <email address hidden>

> Also, Luis: Have you done any investigation to ensure that the
> documentation is reasonable? In particular is the header comment clear,
> clean, and possibly have an example or two?
>
> And, can you verify that all reasonably-possible error conditions are
> documented? At least, are there any other XQuery error codes thrown by the
> module functions (or from the module C++ code, if any)?
> --
> https://code.launchpad.net/~zorba-coders/zorba/bug-1188061/+merge/169553
> You proposed lp:~zorba-coders/zorba/bug-1188061 for merging.
>

--

"The significant problems we face cannot be solved by the same level of
thinking that created them." -- Albert Einstein

lp:~zorba-coders/zorba/bug-1188061 updated
14. By Luis Rodriguez Gonzalez

Header fixed

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

> The documentation has several mentions to tests that are included but no
> textual representations are made, Should I move some of the examples to the
> code instead of sending the user to check the tests?

No, the @example tags are better. The examples will be included in the documentation when the website is generated, but by having them under the test/ directory they're actually executed as part of the RQ, so we know they actually work.

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

Luis - thanks for getting to this module so quickly. Based on this you've raised some coding-guideline issues, such as the use of <p/> and error codes. After discussion with Matthias, I've proposed some clarifications to the coding guidelines document on the Wiki; please take a look and update this proposal accordingly. Thanks!

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

After that, I'm afraid we've got some more substantive changes to be made to JSON-ify this module. I'll update the bug with details. If you'd like, we could merge this first pass (after you've addressed the coding guidelines issues) and then have a separate proposal for the JSONiq updates; otherwise you can continue working on this branch.

Revision history for this message
Chris Hillery (ceejatec) :
review: Needs Fixing
lp:~zorba-coders/zorba/bug-1188061 updated
15. By Luis Rodriguez Gonzalez

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

16. By Luis Rodriguez Gonzalez

Fixed documentation and code issues. Also added several new testcases

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

> After that, I'm afraid we've got some more substantive changes to be made to
> JSON-ify this module. I'll update the bug with details. If you'd like, we
> could merge this first pass (after you've addressed the coding guidelines
> issues) and then have a separate proposal for the JSONiq updates; otherwise
> you can continue working on this branch.

I worked in the changes, please check it, also added some testcases for the new behavior.

lp:~zorba-coders/zorba/bug-1188061 updated
17. By Luis Rodriguez Gonzalez

Forgot to add the new testcases

18. By Luis Rodriguez Gonzalez

Added another testcase to test mixed content (JSON and XML)

19. By Luis Rodriguez Gonzalez

Removing backup files added by mistake

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

Basically the same comments as the queue proposal:

1. Make the error QName variables %private;
2. Fix or eliminate the XQDoc for the error QNames;
3. Replace "node" with "item" in function XQDoc.

In addition:

4. You have a stray <p> at the beginning of the header XQDoc comment (diff line 21).

5. You have </p> in at least 8 places, instead of <p/>.

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

Constants declared as private. Removed <p> and changed </p> for <p/>. Removed comments for private variables.

21. By Luis Rodriguez Gonzalez

All references to nodes were changed to items.

22. 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
Juan Zacarias (juan457) :
review: Approve
lp:~zorba-coders/zorba/bug-1188061 updated
23. By Chris Hillery

Updating expected results.

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 08:49:50 +0000
+++ src/CMakeLists.txt 2013-07-17 01:17:24 +0000
@@ -15,6 +15,6 @@
1515
16##### Stack data structure16##### Stack data structure
1717
18DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/store/data-structures/stack" VERSION 1.0 FILE "stack.xq")18DECLARE_ZORBA_MODULE (URI "http://zorba.io/modules/stack" VERSION 1.0 FILE "stack.xq")
1919
20ADD_TEST_DIRECTORY("${PROJECT_SOURCE_DIR}/test")20ADD_TEST_DIRECTORY("${PROJECT_SOURCE_DIR}/test")
2121
=== modified file 'src/stack.xq'
--- src/stack.xq 2013-06-15 19:49:12 +0000
+++ src/stack.xq 2013-07-17 01:17:24 +0000
@@ -17,12 +17,15 @@
17:)17:)
1818
19(:~19(:~
20 : Implementation of stack for node items, using dynamic collections.<br />20 : Implementation of stack for items, using dynamic collections.<p/>
21 :
22 : Entries in the stack 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/Stack26 : @project Zorba/Data Store/Data Structures/Stack
24 :)27 :)
25module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";28module namespace stack = "http://zorba.io/modules/stack";
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,119 +34,117 @@
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 $stack:errNS as xs:string := "http://zorba.io/modules/stack";
35 : Errors namespace URI.
36:)
37declare variable $stack:errNS as xs:string := "http://www.zorba-xquery.com/modules/store/data-structures/stack";
38 38
39(:~39declare %private variable $stack:NOT-EXISTS as xs:QName := fn:QName($stack:errNS, "stack:NOT-EXISTS");
40 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/store/data-structures/stack" and local name "errNA"40
41:)41declare %private variable $stack:EXISTS as xs:QName := fn:QName($stack:errNS, "stack:EXISTS");
42declare variable $stack:errNA as xs:QName := fn:QName($stack:errNS, "stack:errNA");42
4343(:~
44(:~44 : Create a stack with this name. If stack exists, an error is raised. <p/>
45 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/store/data-structures/stack" and local name "errExists"45 :
46:)46 : @param $name name of the new stack.
47declare variable $stack:errExists as xs:QName := fn:QName($stack:errNS, "stack:errExists");47 : @return an empty sequence.
4848 : @error stack:EXISTS if the stack identified by $name already exists.
49(:~
50 : Create a stack with this name. <br /> If stack exists, an error is raised.
51 : @param $name name of the new stack.
52 : @return ()
53 : @error stack:errExists if the stack identified by $name already exists.
54 :)49 :)
55declare %ann:sequential function stack:create($name as xs:QName) as empty-sequence()50declare %ann:sequential function stack: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($stack:errExists, "Stack already exists.");53 fn:error($stack:EXISTS, "Stack already exists.");
59 else54 else
60 collections-ddl:create($name);55 collections-ddl:create($name);
61};56};
6257
63(:~58(:~
64 : Return the top node in the stack, without removing it.59 : Return the top item in the stack, without removing it. <p/>
65 : @param $name name of the stack.60 :
66 : @return the top node, or empty sequence if stack is empty.61 : @param $name name of the stack.
62 : @return the top item, or empty sequence if stack is empty.
67 : @example test/Queries/top1.xq63 : @example test/Queries/top1.xq
68 : @error stack:errNA if the stack identified by $name does not exist.64 : @error stack:NOT-EXISTS if the stack identified by $name does not exist.
69 :)65 :)
70declare function stack:top($name as xs:QName) as node()?66declare function stack:top($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($stack:errNA, "Stack does not exist.")69 fn:error($stack:NOT-EXISTS, "Stack 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 top node in the stack, and remove it.75 : Return the top item in the stack, and remove it. <p/>
80 : @param $name name of the stack.76 :
81 : @return the top node, or empty sequence if stack is empty.77 : @param $name name of the stack.
78 : @return the top item, or empty sequence if stack is empty.
82 : @example test/Queries/pop2.xq79 : @example test/Queries/pop2.xq
83 : @error stack:errNA if the stack identified by $name does not exist.80 : @error stack:NOT-EXISTS if the stack identified by $name does not exist.
84 :)81 :)
85declare %ann:sequential function stack:pop($name as xs:QName) as node()?82declare %ann:sequential function stack:pop($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($stack:errNA, "Stack does not exist.")85 fn:error($stack:NOT-EXISTS, "Stack does not exist.")
89 else86 else
90 {87 {
91 variable $topNode := collections-dml:collection($name)[1];88 variable $topItem := collections-dml:collection($name)[1];
92 collections-dml:delete-node-first($name);89 collections-dml:delete-first($name);
93 $topNode90 $topItem
94 }91 }
95};92};
9693
97(:~94(:~
98 : Add a new node to the stack; the stack will contain a copy of the given node.95 : Add a new item to the stack; the stack will contain a copy of the given item. <p/>
99 : @param $name name of the stack.96 :
100 : @param $value the node to be added.97 : @param $name name of the stack.
101 : @return ()98 : @param $value the item to be added.
99 : @return an empty sequence.
102 : @example test/Queries/push1.xq100 : @example test/Queries/push1.xq
103 : @error stack:errNA if the stack identified by $name does not exist.101 : @error stack:NOT-EXISTS if the stack identified by $name does not exist.
104 :)102 :)
105declare %ann:sequential function stack:push($name as xs:QName, $value as node()) as empty-sequence()103declare %ann:sequential function stack:push($name as xs:QName, $value as structured-item()) as empty-sequence()
106{104{
107 collections-dml:apply-insert-nodes-first($name, $value);105 collections-dml:apply-insert-first($name, $value);
108};106};
109107
110(:~108(:~
111 : Checks if a stack exists and is empty.109 : Checks if a stack exists and is empty. <p/>
112 : @param $name name of the stack.110 :
113 : @return true is the stack is empty or does not exist.111 : @param $name name of the stack.
112 : @return true if the stack is empty or does not exist.
114 : @example test/Queries/empty1.xq113 : @example test/Queries/empty1.xq
115 : @error stack:errNA if the stack identified by $name does not exist.114 : @error stack:NOT-EXISTS if the stack identified by $name does not exist.
116 :)115 :)
117declare function stack:empty($name as xs:QName) as xs:boolean116declare function stack:empty($name as xs:QName) as xs:boolean
118{117{
119 if(not(collections-ddl:is-available-collection($name))) then118 if(not(collections-ddl:is-available-collection($name))) then
120 fn:error($stack:errNA, "Stack does not exist.")119 fn:error($stack:NOT-EXISTS, "Stack does not exist.")
121 else120 else
122 fn:empty(collections-dml:collection($name))121 fn:empty(collections-dml:collection($name))
123};122};
124123
125(:~124(:~
126 : Count of nodes in the stack.125 : Count of items in the stack. <p/>
127 : @param $name name of the stack.126 :
128 : @return the count of nodes.127 : @param $name name of the stack.
128 : @return the amount of items.
129 : @example test/Queries/size1.xq129 : @example test/Queries/size1.xq
130 : @error stack:errNA if the stack identified by $name does not exist.130 : @error stack:NOT-EXISTS if the stack identified by $name does not exist.
131 :)131 :)
132declare function stack:size($name as xs:QName) as xs:integer132declare function stack:size($name as xs:QName) as xs:integer
133{133{
134 if(not(collections-ddl:is-available-collection($name))) then134 if(not(collections-ddl:is-available-collection($name))) then
135 fn:error($stack:errNA, "Stack does not exist.")135 fn:error($stack:NOT-EXISTS, "Stack does not exist.")
136 else136 else
137 fn:count(collections-dml:collection($name))137 fn:count(collections-dml:collection($name))
138};138};
139139
140(:~140(:~
141 : Copy all nodes from source stack to a destination stack.<br />141 : Copy all items from source stack to a destination stack. <p/>
142 : If destination stack does not exist, it is created first.<br />142 : If destination stack does not exist, it is created first. <p/>
143 : If destination stack is not empty, the nodes are appended on top.143 : If destination stack is not empty, the items are appended on top. <p/>
144 : @param $destName name of the destination stack.144 :
145 : @param $sourceName name of the source stack.145 : @param $destName name of the destination stack.
146 : @return ()146 : @param $sourceName name of the source stack.
147 : @return an empty sequence.
147 : @example test/Queries/copy1.xq148 : @example test/Queries/copy1.xq
148 :)149 :)
149declare %ann:sequential function stack:copy($destName as xs:QName, $sourceName as xs:QName) as empty-sequence()150declare %ann:sequential function stack:copy($destName as xs:QName, $sourceName as xs:QName) as empty-sequence()
@@ -152,5 +153,5 @@
152 collections-ddl:create($destName);153 collections-ddl:create($destName);
153 else154 else
154 ();155 ();
155 collections-dml:insert-nodes-first($destName, collections-dml:collection($sourceName));156 collections-dml:insert-first($destName, collections-dml:collection($sourceName));
156};157};
157158
=== 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 01:17:24 +0000
@@ -0,0 +1,1 @@
1{ "c" : null }{ "c" : null }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/copy-mix.xml.res'
--- test/ExpQueryResults/copy-mix.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/copy-mix.xml.res 2013-07-17 01:17:24 +0000
@@ -0,0 +1,1 @@
1{ "c" : null }{ "c" : null }
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/ExpQueryResults/create-json1.xml.res'
--- test/ExpQueryResults/create-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/create-json1.xml.res 2013-07-17 01:17:24 +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/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 01:17:24 +0000
@@ -0,0 +1,1 @@
1{ "a" : 0 }false{ "a" : 0 }true
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 01:17:24 +0000
@@ -0,0 +1,1 @@
1{ "a" : 0 }
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 01:17:24 +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/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 01:17:24 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
20{ "phi" : 1.6180339 }1{ "phi" : 1.6180339 }0
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/ExpQueryResults/top-json1.xml.res'
--- test/ExpQueryResults/top-json1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/top-json1.xml.res 2013-07-17 01:17:24 +0000
@@ -0,0 +1,1 @@
1{ "a" : null }{ "a" : null }{ "z" : 9.999 }
0\ No newline at end of file2\ No newline at end of file
13
=== 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 01:17:24 +0000
@@ -0,0 +1,11 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4variable $stCopy := fn:QName("", "stackcopy");
5stack:create($stName);
6stack:push($stName, { "a" : 1 });
7stack:push($stName, { "b" : 2.1 });
8stack:push($stName, { "c" : jn:null() });
9stack:copy($stCopy, $stName);
10(stack:top($stName),
11stack:top($stCopy))
012
=== added file 'test/Queries/copy-mix.xq'
--- test/Queries/copy-mix.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/copy-mix.xq 2013-07-17 01:17:24 +0000
@@ -0,0 +1,11 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4variable $stCopy := fn:QName("", "stackcopy");
5stack:create($stName);
6stack:push($stName, { "a" : 1 });
7stack:push($stName, <b/>);
8stack:push($stName, { "c" : jn:null() });
9stack:copy($stCopy, $stName);
10(stack:top($stName),
11stack:top($stCopy))
012
=== modified file 'test/Queries/copy1.xq'
--- test/Queries/copy1.xq 2012-02-29 08:49:50 +0000
+++ test/Queries/copy1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4variable $stCopy := fn:QName("", "stackcopy");4variable $stCopy := fn:QName("", "stackcopy");
55
=== added file 'test/Queries/create-json1.xq'
--- test/Queries/create-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/create-json1.xq 2013-07-17 01:17:24 +0000
@@ -0,0 +1,9 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4(
5 stack:create($stName),
6 stack:push($stName, { "z" : 27 }),
7 stack:push($stName, { "a" : 1 }),
8 stack:top($stName)
9)
010
=== modified file 'test/Queries/create1.xq'
--- test/Queries/create1.xq 2012-03-23 07:56:19 +0000
+++ test/Queries/create1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4(4(
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 01:17:24 +0000
@@ -0,0 +1,12 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4(
5 stack:create($stName),
6 stack:push($stName, { "a" : 0 }),
7 stack:top($stName),
8 stack:empty($stName),
9 stack:pop($stName),
10 stack:top($stName),
11 stack:empty($stName)
12)
013
=== modified file 'test/Queries/empty1.xq'
--- test/Queries/empty1.xq 2012-03-23 07:56:19 +0000
+++ test/Queries/empty1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4(4(
55
=== 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 01:17:24 +0000
@@ -0,0 +1,7 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4stack:create($stName);
5stack:push($stName, { "b" : 1 });
6stack:push($stName, { "a" : 0 });
7stack:pop($stName)
08
=== modified file 'test/Queries/pop1.xq'
--- test/Queries/pop1.xq 2012-02-29 08:49:50 +0000
+++ test/Queries/pop1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4stack:create($stName);4stack:create($stName);
55
=== modified file 'test/Queries/pop2.xq'
--- test/Queries/pop2.xq 2012-02-29 08:49:50 +0000
+++ test/Queries/pop2.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4stack:create($stName);4stack:create($stName);
55
=== 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 01:17:24 +0000
@@ -0,0 +1,6 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4stack:create($stName);
5stack:push($stName, {"a" : 1});
6stack:pop($stName)
07
=== modified file 'test/Queries/push1.xq'
--- test/Queries/push1.xq 2012-02-29 08:49:50 +0000
+++ test/Queries/push1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4stack:create($stName);4stack:create($stName);
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 01:17:24 +0000
@@ -0,0 +1,13 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4(
5 stack:create($stName),
6 stack:size($stName),
7 stack:push($stName, { "phi" : 1.6180339 }),
8 stack:top($stName),
9 stack:size($stName),
10 stack:pop($stName),
11 stack:top($stName),
12 stack:size($stName)
13)
014
=== modified file 'test/Queries/size1.xq'
--- test/Queries/size1.xq 2012-03-23 07:56:19 +0000
+++ test/Queries/size1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4(4(
55
=== added file 'test/Queries/top-json1.xq'
--- test/Queries/top-json1.xq 1970-01-01 00:00:00 +0000
+++ test/Queries/top-json1.xq 2013-07-17 01:17:24 +0000
@@ -0,0 +1,12 @@
1import module namespace stack = "http://zorba.io/modules/stack";
2
3variable $stName := fn:QName("", "stack1");
4(
5 stack:create($stName),
6 stack:push($stName, { "z" : 9.999 }),
7 stack:push($stName, { "a" : jn:null() }),
8 stack:top($stName),
9 stack:pop($stName),
10 stack:pop($stName),
11 stack:top($stName)
12)
013
=== modified file 'test/Queries/top1.xq'
--- test/Queries/top1.xq 2012-02-29 08:49:50 +0000
+++ test/Queries/top1.xq 2013-07-17 01:17:24 +0000
@@ -1,4 +1,4 @@
1import module namespace stack = "http://www.zorba-xquery.com/modules/store/data-structures/stack";1import module namespace stack = "http://zorba.io/modules/stack";
22
3variable $stName := fn:QName("", "stack1");3variable $stName := fn:QName("", "stack1");
4(4(

Subscribers

People subscribed via source and target branches

to all changes: