aboutsummaryrefslogtreecommitdiff
path: root/tests/sortts.at
blob: 3ed321049c9ee4df346ab30fad73845adf40997f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This file is part of Eclat -*- Autotest -*-
# Copyright (C) 2012-2023 Sergey Poznyakoff
#
# Eclat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Eclat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Eclat.  If not, see <http://www.gnu.org/licenses/>.

AT_SETUP([Timestamp sort])
AT_KEYWORDS([sort sortts])

AT_DATA([input],
[<input>
  <collection>
    <item>
      <key>2012-02-20T16:27:51.000Z</key>
      <value>tolvte februar 2012, seksten tjuefem femtien</value>
    </item>
    <item>
      <key>2012-10-14T15:51:00.000Z</key>
      <value>fjortende oktober 2012, femten femtien</value>
    </item>
    <item>
      <key>2011-01-22T00:00:00.000Z</key>
      <value>tjueandre januar 2011, null null</value>
    </item>
    <item>
      <key>2012-02-20T16:25:34.000Z</key>
      <value>tjuende februar 2012, seksten tjuefem trettifire</value>
    </item>
    <item>
      <key>2012-02-22T01:21:22.000Z</key>
      <value>tjueandre februar 2012, ett tjueen tjueto</value>
    </item>
  </collection>
</input>
])

AT_DATA([prog],[sort(.input.collection,".item.key","t");
dump(.);
])

AT_CHECK([tforlan prog input|trws],
[0],
[.input.collection.item.key: "2011-01-22T00:00:00.000Z"
.input.collection.item.value: "tjueandre januar 2011, null null"
.input.collection.item.key: "2012-02-20T16:25:34.000Z"
.input.collection.item.value: "tjuende februar 2012, seksten tjuefem trettifire"
.input.collection.item.key: "2012-02-20T16:27:51.000Z"
.input.collection.item.value: "tolvte februar 2012, seksten tjuefem femtien"
.input.collection.item.key: "2012-02-22T01:21:22.000Z"
.input.collection.item.value: "tjueandre februar 2012, ett tjueen tjueto"
.input.collection.item.key: "2012-10-14T15:51:00.000Z"
.input.collection.item.value: "fjortende oktober 2012, femten femtien"
])

AT_CLEANUP

    

Return to:

Send suggestions and report system problems to the System administrator.