Commit 0b87cb8a authored by 35V LG84's avatar 35V LG84

tep-1009: Phase 1 of new txn hdr syntax, tests

This is all test vectors in new format for phase one.
Signed-off-by: 35V LG84's avatar35V LG84 <35vlg84-x4e6b92@e257.fi>
parent fec62462
Pipeline #52842401 passed with stage
in 5 minutes and 51 seconds
[core]
repositoryformatversion = 0
filemode = true
bare = true
Unnamed repository; edit this file 'description' to name the repository.
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
c6f5f0cfb1439a1fd5e2c1cd2c9261746b7a04a7 refs/heads/master
6fd9d4d31910d9960470413823ec0b96dc2e70ac refs/heads/txns-1E3
75ad8168da60b23541f7c2eb29c2ab4a8293ed8c refs/heads/txns-1E5
P pack-68a18e618257ea5b7d79595a3254112957903bc6.pack
P pack-782d4189aa45001c8eb7cbe7eb3d567b783c1cb6.pack
P pack-be26aa9c2432c6b72aa634bfc55c44f182847e69.pack
# pack-refs with: peeled fully-peeled sorted
c6f5f0cfb1439a1fd5e2c1cd2c9261746b7a04a7 refs/heads/master
6fd9d4d31910d9960470413823ec0b96dc2e70ac refs/heads/txns-1E3
75ad8168da60b23541f7c2eb29c2ab4a8293ed8c refs/heads/txns-1E5
......@@ -177,19 +177,19 @@ class TxnFilterJsonTest extends TxnFilterSpec with FunSpecLike {
val uuidTxn05 = "c6e6cb30-858b-4d9f-8b87-3fae2372136a"
val txnStr =
s"""2018-01-01 abc txn01
| ;:uuid: ${uuidTxn01}
s"""2018-01-01 'abc txn01
| # uuid: ${uuidTxn01}
| ; xyz
| e:b 1.000000001
| a
|
|2018-02-01 (abc) txn02
| ;:uuid: ${uuidTxn02}
|2018-02-01 (abc) 'txn02
| # uuid: ${uuidTxn02}
| e:b 1.0000000011 ; abc hamburger
| a
|
|2018-03-01 (xyz) txn03
| ;:uuid: ${uuidTxn03}
|2018-03-01 (xyz) 'txn03
| # uuid: ${uuidTxn03}
| ; xyz
| ; abc
| ; klm
......@@ -197,12 +197,12 @@ class TxnFilterJsonTest extends TxnFilterSpec with FunSpecLike {
| a
|
|2018-04-01
| ;:uuid: ${uuidTxn04}
| # uuid: ${uuidTxn04}
| e:b:abc 3 ; xyz
| a
|
|2018-05-01
| ;:uuid: ${uuidTxn05}
| # uuid: ${uuidTxn05}
| e:abc:foo 4 EUR
| a
|
......
......@@ -32,19 +32,19 @@ class TxnFilterPostingTest extends TxnFilterSpec with FlatSpecLike {
val uuidTxn05 = "c6e6cb30-858b-4d9f-8b87-3fae2372136a"
val txnStr =
s"""2018-01-01 abc txn01
| ;:uuid: ${uuidTxn01}
s"""2018-01-01 'abc txn01
| # uuid: ${uuidTxn01}
| ; xyz
| e:b 1.000000001
| a
|
|2018-02-01 (abc) txn02
| ;:uuid: ${uuidTxn02}
|2018-02-01 (abc) 'txn02
| # uuid: ${uuidTxn02}
| e:b 1.0000000011 ; abc hamburger
| a
|
|2018-03-01 (xyz) txn03
| ;:uuid: ${uuidTxn03}
|2018-03-01 (xyz) 'txn03
| # uuid: ${uuidTxn03}
| ; xyz
| ; abc
| ; klm
......@@ -52,12 +52,12 @@ class TxnFilterPostingTest extends TxnFilterSpec with FlatSpecLike {
| a
|
|2018-04-01
| ;:uuid: ${uuidTxn04}
| # uuid: ${uuidTxn04}
| e:b:abc 3 ; xyz
| a
|
|2018-05-01
| ;:uuid: ${uuidTxn05}
| # uuid: ${uuidTxn05}
| e:abc:foo 4 EUR
| a
|
......
......@@ -33,19 +33,19 @@ class TxnFilterTxnHeaderTest extends TxnFilterSpec with FlatSpecLike {
val uuidTxn04 = "205d4a48-471c-4015-856c-1c827f8befdd"
val txnStr =
s"""2018-01-01 abc txn01
| ;:uuid: ${uuidTxn01}
s"""2018-01-01 'abc txn01
| # uuid: ${uuidTxn01}
| ; xyz
| e 1
| a
|
|2018-02-01 (abc) txn02
| ;:uuid: ${uuidTxn02}
|2018-02-01 (abc) 'txn02
| # uuid: ${uuidTxn02}
| e 1
| a
|
|2018-03-01 (xyz) txn03
| ;:uuid: ${uuidTxn03}
|2018-03-01 (xyz) 'txn03
| # uuid: ${uuidTxn03}
| ; xyz
| ; abc
| ; klm
......@@ -53,7 +53,7 @@ class TxnFilterTxnHeaderTest extends TxnFilterSpec with FlatSpecLike {
| a
|
|2018-04-01
| ;:uuid: ${uuidTxn04}
| # uuid: ${uuidTxn04}
| e:b:abc 1
| a
|
......@@ -116,7 +116,7 @@ class TxnFilterTxnHeaderTest extends TxnFilterSpec with FlatSpecLike {
*/
it must "filter by txn UUID with no UUID" in {
val txnNoUUIDStr =
s"""2018-01-01 abc txn01
s"""2018-01-01 'abc txn01
| ; xyz
| e 1
| a
......
......@@ -34,23 +34,23 @@ class TxnFilterTxnTSBeginTest extends TxnFilterSpec with FlatSpecLike {
val uuidTSDate04 = "205d4a48-471c-4015-856c-1c827f8befdd"
val txnStrTSDate =
s"""2018-01-01 txn01
| ;:uuid: ${uuidTSDate01}
s"""2018-01-01 'txn01
| # uuid: ${uuidTSDate01}
| e 1
| a
|
|2018-02-01 txn02
| ;:uuid: ${uuidTSDate02}
|2018-02-01 'txn02
| # uuid: ${uuidTSDate02}
| e 1
| a
|
|2018-03-01 txn03
| ;:uuid: ${uuidTSDate03}
|2018-03-01 'txn03
| # uuid: ${uuidTSDate03}
| e 1
| a
|
|2018-04-01 txn04
| ;:uuid: ${uuidTSDate04}
|2018-04-01 'txn04
| # uuid: ${uuidTSDate04}
| e 1
| a
|
......@@ -64,17 +64,17 @@ class TxnFilterTxnTSBeginTest extends TxnFilterSpec with FlatSpecLike {
val txnStrTSTime =
s"""2018-01-01T11:00:00
| ;:uuid: ${uuidTSTime01}
| # uuid: ${uuidTSTime01}
| e 1
| a
|
|2018-01-01T23:00:00
| ;:uuid: ${uuidTSTime02}
| # uuid: ${uuidTSTime02}
| e 1
| a
|
|2018-01-02T00:00:00
| ;:uuid: ${uuidTSTime03}
| # uuid: ${uuidTSTime03}
| e 1
| a
|
......@@ -89,17 +89,17 @@ class TxnFilterTxnTSBeginTest extends TxnFilterSpec with FlatSpecLike {
val txnStrTSNano =
s"""2018-01-01T14:00:00.123456787
| ;:uuid: ${uuidTSNano01}
| # uuid: ${uuidTSNano01}
| e 1
| a
|
|2018-01-01T14:00:00.123456788
| ;:uuid: ${uuidTSNano02}
| # uuid: ${uuidTSNano02}
| e 1
| a
|
|2018-01-01T14:00:00.123456789
| ;:uuid: ${uuidTSNano03}
| # uuid: ${uuidTSNano03}
| e 1
| a
|
......@@ -113,18 +113,18 @@ class TxnFilterTxnTSBeginTest extends TxnFilterSpec with FlatSpecLike {
val txnStrTSZone =
s"""2018-01-04T09:00:00+10:00
| ;:uuid: ${uuidTSZone01}
| # uuid: ${uuidTSZone01}
| e 1
| a
|
|2018-01-03T18:00:00-06:00
| ;:uuid: ${uuidTSZone02}
| # uuid: ${uuidTSZone02}
| ; Zone support must be tested with offsets which cancel each others (e.g. result is same time in UTC)
| e 1
| a
|
|2018-01-04T00:00:00
| ;:uuid: ${uuidTSZone03}
| # uuid: ${uuidTSZone03}
| e 1
| a
|
......
......@@ -34,17 +34,17 @@ class TxnFilterTxnTSEndTest extends TxnFilterSpec with FlatSpecLike{
val txnStrTSDate =
s"""2018-01-01
| ;:uuid: ${uuidTSDate01}
| # uuid: ${uuidTSDate01}
| e 1
| a
|
|2018-02-01
| ;:uuid: ${uuidTSDate02}
| # uuid: ${uuidTSDate02}
| e 1
| a
|
|2018-03-01
| ;:uuid: ${uuidTSDate03}
| # uuid: ${uuidTSDate03}
| e 1
| a
|
......@@ -57,17 +57,17 @@ class TxnFilterTxnTSEndTest extends TxnFilterSpec with FlatSpecLike{
val txnStrTSTime =
s"""2018-01-01T11:00:00
| ;:uuid: ${uuidTSTime01}
| # uuid: ${uuidTSTime01}
| e 1
| a
|
|2018-01-01T23:00:00
| ;:uuid: ${uuidTSTime02}
| # uuid: ${uuidTSTime02}
| e 1
| a
|
|2018-01-02T00:00:00
| ;:uuid: ${uuidTSTime03}
| # uuid: ${uuidTSTime03}
| e 1
| a
|
......@@ -82,17 +82,17 @@ class TxnFilterTxnTSEndTest extends TxnFilterSpec with FlatSpecLike{
val txnStrTSNano =
s"""2018-01-01T14:00:00.123456787
| ;:uuid: ${uuidTSNano01}
| # uuid: ${uuidTSNano01}
| e 1
| a
|
|2018-01-01T14:00:00.123456788
| ;:uuid: ${uuidTSNano02}
| # uuid: ${uuidTSNano02}
| e 1
| a
|
|2018-01-01T14:00:00.123456789
| ;:uuid: ${uuidTSNano03}
| # uuid: ${uuidTSNano03}
| e 1
| a
|
......@@ -106,18 +106,18 @@ class TxnFilterTxnTSEndTest extends TxnFilterSpec with FlatSpecLike{
val txnStrTSZone =
s"""2018-01-04T09:00:00+10:00
| ;:uuid: ${uuidTSZone01}
| # uuid: ${uuidTSZone01}
| e 1
| a
|
|2018-01-03T18:00:00-06:00
| ;:uuid: ${uuidTSZone02}
| # uuid: ${uuidTSZone02}
| ; Zone support must be tested with offsets which cancel each others (e.g. result is same time in UTC)
| e 1
| a
|
|2018-01-04T00:00:00
| ;:uuid: ${uuidTSZone03}
| # uuid: ${uuidTSZone03}
| e 1
| a
|
......
......@@ -33,18 +33,18 @@ class TxnDataTest extends FunSpec {
val uuid03 = "dd3bf34b-78e9-4a80-9072-8503c462f7c3"
val strUUIDs =
s"""2019-01-01 txn01
| ;:uuid: ${uuid01}
s"""2019-01-01 'txn01
| # uuid: ${uuid01}
| e 1
| a
|
|2019-02-01 txn02
| ;:uuid: ${"\t"}${uuid02}${"\t"}${" "}
|2019-02-01 'txn02
| # uuid: ${"\t"}${uuid02}${"\t"}${" "}
| e 1
| a
|
|2019-03-01 txn03
| ;:uuid: ${uuid03}
|2019-03-01 'txn03
| # uuid: ${uuid03}
| e 1
| a
|
......@@ -52,7 +52,7 @@ class TxnDataTest extends FunSpec {
val strNoUUID =
s"""
|2019-04-01 txn04
|2019-04-01 'txn04
| e 1
| a
|
......@@ -60,8 +60,8 @@ class TxnDataTest extends FunSpec {
val strDuplicateUUID =
s"""
|2019-04-01 txn04
| ;:uuid: ${uuid02}
|2019-04-01 'txn04
| # uuid: ${uuid02}
| e 1
| a
|
......
......@@ -31,7 +31,7 @@ class TacklerParserAccountsTest extends FunSpec {
(
// perr: '::'
"""
|2017-01-01 desc
|2017-01-01
| a::b 1
| e
|
......@@ -42,7 +42,7 @@ class TacklerParserAccountsTest extends FunSpec {
(
// perr: :a
"""
|2017-01-01 desc
|2017-02-02
| :a 1
| e
|
......@@ -53,7 +53,7 @@ class TacklerParserAccountsTest extends FunSpec {
(
// perr: a:
"""
|2017-01-01 desc
|2017-03-03
| a: 1
| e
|
......
/*
* Copyright 2019 E257.FI
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package fi.e257.tackler.parser
import fi.e257.tackler.core.Settings
import org.scalatest.FunSpec
class TacklerParserHeaderCodeTest extends FunSpec {
describe("Code") {
/**
* test:
*/
ignore("check invalid code constructs") {
val perrStrings: List[(String, String, String)] = List(
(
"""
|2017-01-01 (123
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (123))
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ')'"""
),
(
"""
|2017-01-01 ((123))
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (123)abc
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input 'abc'"""
),
(
"""
|2017-01-01 (123)a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input 'a'"""
),
(
"""
|2017-01-01 (a'a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a[a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a]a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a{a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a}a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a<a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 (a>a)
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( ' )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( [ )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( ] )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( { )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( } )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( < )
| a 1
| e 1
|
|""".stripMargin,
"on line: 2",
"""at input ' '"""
),
(
"""
|2017-01-01 ( > )