This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit b5b8b95372d00ebca9e2d013da901bd455d0875b Author: Jim Jagielski <[email protected]> AuthorDate: Wed Nov 18 10:47:55 2026 -0500 test/odf-validate: more calcval cases for the post-#523 functions Edge cases for ISOWEEKNUM, HYPGEOMDIST, F.DIST, F.INV, FINDB, SEARCHB and REPLACEB, from Pedro's cases with the expected values recomputed; several of his were wrong. SEARCHB goes by regex, not wildcards. --- test/odf-validate/calcval-cases14.tsv | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/odf-validate/calcval-cases14.tsv b/test/odf-validate/calcval-cases14.tsv index f30b899c1f..b8c0e55d7f 100644 --- a/test/odf-validate/calcval-cases14.tsv +++ b/test/odf-validate/calcval-cases14.tsv @@ -375,3 +375,54 @@ ODDFPRICE.redemption =ODDFPRICE(DATE(2008;11;11);DATE(2021;3;1);DATE(2008;10;15) ODDFYIELD.short =ODDFYIELD(DATE(2008;11;11);DATE(2021;3;1);DATE(2008;10;15);DATE(2009;3;1);0.0575;84.5;100;2;0) cell 0.07724554159781741 6.12.32 Excel example ODDFYIELD.long =ODDFYIELD(DATE(2022;8;2);DATE(2028;4;5);DATE(2021;11;16);DATE(2023;10;5);0.0764;ODDFPRICE(DATE(2022;8;2);DATE(2028;4;5);DATE(2021;11;16);DATE(2023;10;5);0.0764;0.1492;100;2;2);100;2;2) cell 0.1492 6.12.32 inverse of ODDFPRICE ODDFYIELD.redemption =ODDFYIELD(DATE(2008;11;11);DATE(2021;3;1);DATE(2008;10;15);DATE(2009;3;1);0.0575;84.5;0;2;0) cell #ERR 6.12.32 Redemption > 0 +ISOWEEKNUM.jan1.mon =ISOWEEKNUM(DATE(2024;1;1)) cell 1 6.10.12 Monday 2024-01-01 starts week 1 +ISOWEEKNUM.jan1.wed =ISOWEEKNUM(DATE(2025;1;1)) cell 1 6.10.12 Wednesday 2025-01-01 is in week 1 +ISOWEEKNUM.jan4 =ISOWEEKNUM(DATE(2024;1;4)) cell 1 6.10.12 January 4 is always in week 1 +ISOWEEKNUM.dec31 =ISOWEEKNUM(DATE(2024;12;31)) cell 1 6.10.12 Tuesday 2024-12-31 is in week 1 of 2025 +ISOWEEKNUM.week53.2015 =ISOWEEKNUM(DATE(2015;12;31)) cell 53 6.10.12 2015 has 53 weeks +ISOWEEKNUM.week52.2021 =ISOWEEKNUM(DATE(2021;12;31)) cell 52 6.10.12 Friday 2021-12-31 is in week 52 +ISOWEEKNUM.dec28.2020 =ISOWEEKNUM(DATE(2020;12;28)) cell 53 6.10.12 Monday 2020-12-28 starts week 53 +ISOWEEKNUM.jan4.2023 =ISOWEEKNUM(DATE(2023;1;4)) cell 1 6.10.12 Wednesday 2023-01-04 is in week 1 +ISOWEEKNUM.dec28.2023 =ISOWEEKNUM(DATE(2023;12;28)) cell 52 6.10.12 Thursday 2023-12-28 is in week 52 +ISOWEEKNUM.leap.feb28 =ISOWEEKNUM(DATE(2024;2;28)) cell 9 6.10.12 around the leap day +ISOWEEKNUM.leap.feb29 =ISOWEEKNUM(DATE(2024;2;29)) cell 9 6.10.12 the leap day +ISOWEEKNUM.leap.mar1 =ISOWEEKNUM(DATE(2024;3;1)) cell 9 6.10.12 after the leap day +ISOWEEKNUM.y2000 =ISOWEEKNUM(DATE(2000;1;1)) cell 52 6.10.12 Saturday 2000-01-01 is in week 52 of 1999 +ISOWEEKNUM.y2100 =ISOWEEKNUM(DATE(2100;1;1)) cell 53 6.10.12 Friday 2100-01-01 is in week 53 of 2099 +ISOWEEKNUM.sunday =ISOWEEKNUM(DATE(2024;6;16)) cell 24 6.10.12 weeks end on Sunday +ISOWEEKNUM.monday =ISOWEEKNUM(DATE(2024;6;17)) cell 25 6.10.12 weeks start on Monday +ISOWEEKNUM.timefrac =ISOWEEKNUM(DATE(2024;6;15)+0.5) cell 24 6.10.12 the time of day is ignored +ISOWEEKNUM.text =ISOWEEKNUM("not a date") cell #ERR 6.10.12 text that is no date +HYPGEOMDIST.x0.pmf =HYPGEOMDIST(0;5;10;20) cell 0.016253869969040248 6.18.37 x = 0 +HYPGEOMDIST.x0.cdf =HYPGEOMDIST(0;5;10;20;1) cell 0.016253869969040248 6.18.37 cumulative at x = 0 is the probability of 0 +HYPGEOMDIST.small.pmf =HYPGEOMDIST(1;4;4;10;0) cell 0.38095238095238093 6.18.37 C(4,1)C(6,3)/C(10,4) +HYPGEOMDIST.small.cdf =HYPGEOMDIST(1;4;4;10;1) cell 0.4523809523809524 6.18.37 cumulative, x past the mode +HYPGEOMDIST.high.pmf =HYPGEOMDIST(2;2;90;100;0) cell 0.8090909090909091 6.18.37 mass close to 1 +HYPGEOMDIST.high.cdf =HYPGEOMDIST(2;2;90;100;1) cell 1 6.18.37 x = n takes in every outcome +HYPGEOMDIST.x.neg =HYPGEOMDIST(-1;5;10;20) cell #ERR 6.18.37 x < 0 +HYPGEOMDIST.x.gt.M =HYPGEOMDIST(3;5;2;20) cell #ERR 6.18.37 x > M +HYPGEOMDIST.n.gt.N =HYPGEOMDIST(1;11;5;10) cell #ERR 6.18.37 n > N +HYPGEOMDIST.M.gt.N =HYPGEOMDIST(1;1;21;20) cell #ERR 6.18.37 M > N +HYPGEOMDIST.x.lt.min =HYPGEOMDIST(0;10;15;20) cell #ERR 6.18.37 x < n - N + M +HYPGEOMDIST.cdf.x.gt.n =HYPGEOMDIST(6;5;10;20;1) cell #ERR 6.18.37 the cumulative form checks the domain too +F.DIST.df1.huge =F.DIST(2.5;1E10;10) cell #ERR 6.18.22 degrees of freedom below 1E10 +F.DIST.df2.huge =F.DIST(2.5;5;1E10) cell #ERR 6.18.22 degrees of freedom below 1E10 +F.DIST.df.floor =F.DIST(2.5;5.9;10.9)-F.DIST(2.5;5;10) cell 0 degrees of freedom are truncated to integers +F.INV.df1.huge =F.INV(0.5;1E10;10) cell #ERR 6.18.24 degrees of freedom below 1E10 +F.INV.df2.huge =F.INV(0.5;5;1E10) cell #ERR 6.18.24 degrees of freedom below 1E10 +F.INV.df.bad =F.INV(0.5;0;10) cell #ERR 6.18.24 degrees of freedom of at least 1 +F.INV.p.neg =F.INV(-0.1;5;10) cell #ERR 6.18.24 probability below 0 +F.INV.p.over =F.INV(1.5;5;10) cell #ERR 6.18.24 probability above 1 +FINDB.start.second =FINDB("b";"abc";2) cell 2 6.7.2 start at the match +FINDB.dbcs.first =FINDB("中";"中国") cell 1 6.7.2 first CJK character is at byte 1 +FINDB.dbcs.start =FINDB("国";"中国";3) cell 3 6.7.2 start at the second CJK character +SEARCHB.regex.dot =SEARCHB("a.c";"abc") cell 1 6.7.8 regular expressions are on in a new document +SEARCHB.regex.star =SEARCHB("a*c";"abc") cell 1 6.7.8 regular expression, not a wildcard +SEARCHB.regex.opt =SEARCHB("a?c";"abc") cell 3 6.7.8 a? is optional a, so the match is the c; as a wildcard it would be 1 +SEARCHB.mixed =SEARCHB("b";"a中b") cell 4 6.7.8 1 + 2 bytes before b +SEARCHB.start.past =SEARCHB("a";"abc";4) cell #ERR 6.7.8 start past the text +REPLACEB.multi =REPLACEB("abcdef";2;2;"xy") cell s:axydef 6.7.6 replace two bytes +REPLACEB.all =REPLACEB("abc";1;3;"xyz") cell s:xyz 6.7.6 replace the whole text +REPLACEB.start.past =REPLACEB("abc";10;1;"x") cell s:abcx 6.7.6 start far past the end appends +REPLACEB.dbcs.first =REPLACEB("中国";1;2;"家") cell s:家国 6.7.6 first CJK character is bytes 1-2 +REPLACEB.dbcs.last =REPLACEB("中国";3;2;"家") cell s:中家 6.7.6 second CJK character is bytes 3-4
