Skip to content

Commit

Permalink
Fixing tests realted to rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Mar 4, 2025
1 parent ac341dc commit f7380df
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 41 deletions.
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_build_explicit_stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_build_input_file
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_build_merge_values
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "1f2afbcbdda51a5fc5b81300a406d27cf31f48f6a6ecd269b2cb8810f42cf1a2"
"val": "aa4ce3a998bd7a6523730ae5e08e1c791f504121263499e51598499e5a0f6ff6"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_build_output_file_outfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_build_overwrite_output_file_outfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_sign_explicit_stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_sign_input_file
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_sign_merge_values
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "2dff8279b81655599c7a82b8991c68e93cf327f152720cb74ae57b46a4927b40"
"val": "63a34456e8508328c8706544554b79a1ec37fb5bbcc86797f58f232796565784"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_sign_output_file_outfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/gobl/testdata/Test_sign_overwrite_output_file_outfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50",
"dig": {
"alg": "sha256",
"val": "87d4a01626fd62e7d19ecefc072fbd966ae1837e9d81e84eb68d0d452f58bb68"
"val": "7a28e3ac52dc87a13f13ad9af168f9d37379c6795b082a700d9c462a176c8e93"
}
},
"doc": {
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"reason": "Special discount",
"percent": "10%",
"amount": "180.00"
"amount": "180.0000"
}
],
"taxes": [
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/testdata/TestBuild_do_not_envelop
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down
6 changes: 3 additions & 3 deletions internal/cli/testdata/TestBuild_envelop
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down Expand Up @@ -131,8 +131,8 @@
"head": {
"dig": {
"alg": "sha256",
"val": "ecfb05ab04c40c616689b3505e380e36c7e81a00bb18a44499dc719aabeca6e9"
"val": "9bbc20a184bfdd062f0a2e218364afd9212606cd94fa8ad984bff6f8790650ab"
},
"uuid": "019205ab-ab75-7148-b21a-f36dfdf1bf1e"
"uuid": "0195634a-b6b9-772f-ab8a-5435016ad06f"
}
}
4 changes: 2 additions & 2 deletions internal/cli/testdata/TestBuild_with_signature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down Expand Up @@ -131,7 +131,7 @@
"head": {
"dig": {
"alg": "sha256",
"val": "f46d4faf052c8e38a90f4659fda55e0f39ad1910d6014e68756a6a5afd4ab3cf"
"val": "5f103aa74ca56eda4205846b41bde5597569bab40a459bbb8436619c05c63da0"
},
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50"
}
Expand Down
8 changes: 4 additions & 4 deletions internal/cli/testdata/TestCorrect_success
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down Expand Up @@ -137,13 +137,13 @@
"total_with_tax": "1717.20"
},
"type": "credit-note",
"uuid": "019205ab-ac40-7dc4-b558-021c44c5c42b"
"uuid": "0195634a-b799-7bca-b24b-c65a0f459bd8"
},
"head": {
"dig": {
"alg": "sha256",
"val": "532c0cd12d1ffe9e9ab643b43624a9a71da58997e07505831373b7a756bdd090"
"val": "b9e152835a28b8744bb140b28bc7d9e31945c53a77e3b53c8719c36da908c2ef"
},
"uuid": "019205ab-ac40-7db7-a667-3ffba02c4158"
"uuid": "0195634a-b799-7bc4-b397-53e1e932b770"
}
}
2 changes: 1 addition & 1 deletion internal/cli/testdata/TestCorrect_success_just_invoice
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down
10 changes: 5 additions & 5 deletions internal/cli/testdata/TestReplicate_success
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"country": "ES"
}
},
"issue_date": "2024-09-18",
"issue_date": "2025-03-04",
"lines": [
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down Expand Up @@ -126,13 +126,13 @@
"total_with_tax": "1717.20"
},
"type": "standard",
"uuid": "019205ab-ac49-72cf-8266-f8261d898b74"
"uuid": "0195634a-b7a4-757b-9878-a2af7fa3dce9"
},
"head": {
"dig": {
"alg": "sha256",
"val": "7196267028039b271cb71b87fec25e1321806be5b7f36a0cf807fdbacdc08a56"
"val": "c2beac8f56bde14c045b34d3338b65b0a12415c03ee48fd26cf99bab6ef8036d"
},
"uuid": "019205ab-ac49-72d6-acdc-be2fada07fbc"
"uuid": "0195634a-b7a4-7581-b7f9-4aa4eb1986c0"
}
}
9 changes: 4 additions & 5 deletions internal/cli/testdata/TestSign_with_signature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"discounts": [
{
"amount": "180.00",
"amount": "180.0000",
"percent": "10%",
"reason": "Special discount"
}
Expand Down Expand Up @@ -131,13 +131,12 @@
"head": {
"dig": {
"alg": "sha256",
"val": "f46d4faf052c8e38a90f4659fda55e0f39ad1910d6014e68756a6a5afd4ab3cf"
"val": "5f103aa74ca56eda4205846b41bde5597569bab40a459bbb8436619c05c63da0"
},
"uuid": "4905f174-0384-11ed-9fa6-b24117999d50"
},
"sigs": [
"eyJhbGciOiJFUzI1NiIsImtpZCI6ImI3Y2VlNjBmLTIwNGUtNDM4Yi1hODhmLTAyMWQyOGFmNjk5MSJ9.eyJ1dWlkIjoiNDkwNWYxNzQtMDM4NC0xMWVkLTlmYTYtYjI0MTE3OTk5ZDUwIiwiZGlnIjp7ImFsZyI6InNoYTI1NiIsInZhbCI6ImYxZDU0ZDQzNGJhMDdkZGQ5MGYzM2Q3MTFmNmE2NzI1YTgwMjI4ZjgwY2Q4MzFmMTFmY2FhMjEzNTc3OTY1NzEifX0.RRcEnMEaexaM27aXlR1V4Wqox5ZNoF6MgteqvX7wsS08GkdFVS1EDOh_rm_zCV6RRryu6jrLEb7lnyGPy8pIiw",
"eyJhbGciOiJFUzI1NiIsImtpZCI6ImI3Y2VlNjBmLTIwNGUtNDM4Yi1hODhmLTAyMWQyOGFmNjk5MSJ9.eyJ1dWlkIjoiNDkwNWYxNzQtMDM4NC0xMWVkLTlmYTYtYjI0MTE3OTk5ZDUwIiwiZGlnIjp7ImFsZyI6InNoYTI1NiIsInZhbCI6ImVhNDk1MDZjMjJjZjE1ZjMzOWIzY2ZkNGRjMmJjMzU0M2Y0OWUwOWMyZTA0NWNkMzFkOTMyYzQwOGZhZmRlYzMifX0.P_ystp5Ou08ExZaJv_kCgxxTjI-SiG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