From 951a4e12a743329adf732f14d3fcac723e263299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Adel=C3=A9?= Date: Mon, 27 Nov 2023 07:36:18 +0100 Subject: [PATCH] fix: unit test check version --- samples/generated_by_sh.yaml | 2 +- samples/generated_by_ts.yaml | 2 +- samples/sample.cfwf | 124 ----------------------------------- samples/sample.yaml | 62 ------------------ src/cfwf_test.ts | 8 +-- 5 files changed, 6 insertions(+), 192 deletions(-) delete mode 100644 samples/sample.cfwf delete mode 100644 samples/sample.yaml diff --git a/samples/generated_by_sh.yaml b/samples/generated_by_sh.yaml index cafd67e..056b2a8 100644 --- a/samples/generated_by_sh.yaml +++ b/samples/generated_by_sh.yaml @@ -1,7 +1,7 @@ --- dataset: metadatas: - generated_with: 'cfwf@0.0.1 - https://github.com/badele/cfwf' + generated_with: 'cfwf@0.4.0 - https://github.com/badele/cfwf' orders: - players - australian_open diff --git a/samples/generated_by_ts.yaml b/samples/generated_by_ts.yaml index cafd67e..056b2a8 100644 --- a/samples/generated_by_ts.yaml +++ b/samples/generated_by_ts.yaml @@ -1,7 +1,7 @@ --- dataset: metadatas: - generated_with: 'cfwf@0.0.1 - https://github.com/badele/cfwf' + generated_with: 'cfwf@0.4.0 - https://github.com/badele/cfwf' orders: - players - australian_open diff --git a/samples/sample.cfwf b/samples/sample.cfwf deleted file mode 100644 index 5658154..0000000 --- a/samples/sample.cfwf +++ /dev/null @@ -1,124 +0,0 @@ - - ___ _____ ______ _____ - / _ \ |_ _|| ___ \ |_ _| - / /_\ \ | | | |_/ / | | ___ _ _ _ __ - | _ | | | | __/ | | / _ \ | | | || '__| - | | | | | | | | | | | (_) || |_| || | - \_| |_/ \_/ \_| \_/ \___/ \__,_||_| - - ┈┈┈ -Here is a list of the best tennis players in the ATP rankings -from 2012 to 2022, as well as the list of winners of the -4 major Grand Slam tournaments. - ┄┄┄ - -players -The best players (number of winning matches) beetween 2012-2022 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -winner_ioc name_first name_last hand height birth nbwins -────────── ────────── ───────── ──── ────── ───── ────── -SRB Novak Djokovic R 188 1987 64 -ESP Rafael Nadal L 185 1986 46 -SUI Roger Federer R 185 1981 33 -GBR Andy Murray R 190 1987 25 -GER Alexander Zverev R 198 1997 19 -AUT Dominic Thiem R 185 1993 17 -RUS Daniil Medvedev R 198 1996 16 -ESP David Ferrer R 175 1982 16 -CRO Marin Cilic R 198 1988 14 -RUS Andrey Rublev R 188 1997 13 -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -The Australian Open is a tennis tournament held annually at Melbourne Park -in Melbourne, Victoria, Australia. The tournament is the first of the -four Grand Slam tennis events held each year. - -australian_open -Australian Open winners beetween 2012-2022 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -year tourney name birth nat winner -──── ─────────────── ───────── ────────────── -2022 Australian Open ESP Rafael Nadal -2021 Australian Open SRB Novak Djokovic -2020 Australian Open SRB Novak Djokovic -2019 Australian Open SRB Novak Djokovic -2018 Australian Open SUI Roger Federer -2017 Australian Open SUI Roger Federer -2016 Australian Open SRB Novak Djokovic -2015 Australian Open SRB Novak Djokovic -2014 Australian Open SUI Stan Wawrinka -2013 Australian Open SRB Novak Djokovic -2012 Australian Open SRB Novak Djokovic -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -The major tennis tournament held over two weeks at the Stade Roland Garros -in Paris, France, beginning in late May each year. The tournament and venue are -named after the French aviator Roland Garros. The French Open is the premier -clay court championship in the world and the only Grand Slam tournament -currently held on this surface. - -roland_garros -Roland Garros winners beetween 2012-2022 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -year tourney name birth nat winner -──── ───────────── ───────── ────────────── -2022 Roland Garros ESP Rafael Nadal -2021 Roland Garros SRB Novak Djokovic -2020 Roland Garros ESP Rafael Nadal -2019 Roland Garros ESP Rafael Nadal -2018 Roland Garros ESP Rafael Nadal -2017 Roland Garros ESP Rafael Nadal -2016 Roland Garros SRB Novak Djokovic -2015 Roland Garros SUI Stan Wawrinka -2014 Roland Garros ESP Rafael Nadal -2013 Roland Garros ESP Rafael Nadal -2012 Roland Garros ESP Rafael Nadal -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -The US Open Tennis Championships, commonly called the US Open, is a hardcourt tennis -tournament held annually in Queens, New York. Since 1987, the US Open has been -chronologically the fourth and final Grand Slam tournament of the year. - -us_open -US Open winners beetween 2012-2022 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -year tourney name birth nat winner -──── ──────────── ───────── ─────────────── -2022 Us Open ESP Carlos Alcaraz -2021 Us Open RUS Daniil Medvedev -2020 Us Open AUT Dominic Thiem -2019 US Open ESP Rafael Nadal -2018 US Open SRB Novak Djokovic -2017 US Open ESP Rafael Nadal -2016 US Open SUI Stan Wawrinka -2015 US Open SRB Novak Djokovic -2014 US Open CRO Marin Cilic -2013 US Open ESP Rafael Nadal -2012 US Open GBR Andy Murray -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -The Championships, commonly known simply as Wimbledon, is the oldest tennis tournament -in the world and is regarded by many as the most prestigious. -It has been held at the All England Lawn Tennis and Croquet Club in Wimbledon, London, since 1877 - -wimbledon -Wimbledon winners beetween 2012-2022 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -year tourney name birth nat winner -──── ──────────── ───────── ────────────── -2022 Wimbledon SRB Novak Djokovic -2021 Wimbledon SRB Novak Djokovic -2019 Wimbledon SRB Novak Djokovic -2018 Wimbledon SRB Novak Djokovic -2017 Wimbledon SUI Roger Federer -2016 Wimbledon GBR Andy Murray -2015 Wimbledon SRB Novak Djokovic -2014 Wimbledon SRB Novak Djokovic -2013 Wimbledon GBR Andy Murray -2012 Wimbledon SUI Roger Federer -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/samples/sample.yaml b/samples/sample.yaml deleted file mode 100644 index cafd67e..0000000 --- a/samples/sample.yaml +++ /dev/null @@ -1,62 +0,0 @@ ---- -dataset: - metadatas: - generated_with: 'cfwf@0.0.1 - https://github.com/badele/cfwf' - orders: - - players - - australian_open - - roland_garros - - us_open - - wimbledon - sources: - - 'https://github.com/JeffSackmann/tennis_atp' - title: ' ATP Tour' -tables: - australian_open: - metadatas: - aligns: - - right - - left - - center - - center - sources: - - 'https://fr.wikipedia.org/wiki/Open_d%27Australie' - players: - metadatas: - aligns: - - left - - right - - left - - center - - right - - right - - right - sources: - - 'https://github.com/JeffSackmann/tennis_atp' - roland_garros: - metadatas: - aligns: - - right - - left - - center - - center - sources: - - 'https://fr.wikipedia.org/wiki/Internationaux_de_France_de_tennis' - us_open: - metadatas: - aligns: - - right - - left - - center - - center - sources: - - 'https://fr.wikipedia.org/wiki/US_Open_de_tennis' - wimbledon: - metadatas: - aligns: - - right - - left - - center - - center - sources: - - 'https://fr.wikipedia.org/wiki/Tournoi_de_Wimbledon' diff --git a/src/cfwf_test.ts b/src/cfwf_test.ts index 78f833c..be7f0bc 100644 --- a/src/cfwf_test.ts +++ b/src/cfwf_test.ts @@ -224,14 +224,14 @@ test("Title & comment", async () => { assertEquals(`${footer}`, dsinfos.dataset.metadatas.generated_with); }); -test("Columns and headers columns size from sample.cfwf", async () => { +test("Columns and headers columns size from generated_by_sh.cfwf", async () => { const options: CFWFOptions = { chartabletop: "━", chartablemiddle: "─", chartablebottom: "━", }; - const content = await readTextCFWFFile("samples/sample.cfwf"); + const content = await readTextCFWFFile("samples/generated_by_sh.cfwf"); const lines = content.split("\n"); const titlemarkerpos = searchMarker(lines, chartitlesep || ""); @@ -487,7 +487,7 @@ test("Number & array", async () => { // }); test("Feature (no key element can be found in the doc with marker", async () => { - const content = await readTextCFWFFile("samples/sample.cfwf"); + const content = await readTextCFWFFile("samples/generated_by_sh.cfwf"); const lines = content.split("\n"); let idx = 0; @@ -510,7 +510,7 @@ test("Feature (no key element can be found in the doc with marker", async () => test("Reader & regenerate", async () => { const samples = new CFWF({}); - const content = await readTextCFWFFile("samples/sample.cfwf"); + const content = await readTextCFWFFile("samples/generated_by_sh.cfwf"); samples.importCFWF(content); await samples.saveCFWF("samples/samples_regenerated.cfwf", false);