-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
681 changed files
with
3,554 additions
and
1,622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Check links in documentation | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/check-links.yml' | ||
- 'lychee.toml' | ||
- '**/*.md' | ||
schedule: | ||
# Run on the first of each month at 9:00 AM | ||
- cron: "0 9 1 * *" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.head_ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lychee: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Restore lychee cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .lycheecache | ||
key: cache-lychee-${{ github.sha }} | ||
restore-keys: cache-lychee- | ||
|
||
- name: Check links | ||
id: lychee | ||
uses: lycheeverse/[email protected] | ||
with: | ||
fail: true | ||
args: --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...ent/jdplus-sa-base-csv/src/test/java/jdplus/sa/base/csv/TsCollectionCsvFormatterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package jdplus.sa.base.csv; | ||
|
||
import jdplus.toolkit.base.api.timeseries.TsData; | ||
import nbbrd.design.MightBePromoted; | ||
import nbbrd.io.function.IOConsumer; | ||
import org.junit.jupiter.api.Test; | ||
import tck.demetra.data.DataGenerator; | ||
|
||
import java.io.IOException; | ||
import java.io.StringWriter; | ||
import java.io.Writer; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class TsCollectionCsvFormatterTest { | ||
|
||
@Test | ||
public void testWriteVTable() throws IOException { | ||
TsCollectionCsvFormatter x = new TsCollectionCsvFormatter(); | ||
x.setPresentation(CsvLayout.VTable); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(), List.of(), w))) | ||
.isEmpty(); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(TsData.empty("no data")), List.of("S1"), w))) | ||
.isEmpty(); | ||
|
||
assertThat(writeToString(w -> x.write(DataGenerator.BY_INDEX.listOfTsData("R0/2010-01-01T00:00:00/P1M", "R3/2010-01-01T00:00:00/P1M", "R1/2010-01-01T00:00:00/P3M"), List.of("S1", "S2", "S3"), w))) | ||
.isEqualToNormalizingNewlines( | ||
""" | ||
,S1,S2,S3 | ||
2010-01-01,,1.1, | ||
2010-02-01,,2.2, | ||
2010-03-01,,3.3,1.1 | ||
""" | ||
); | ||
} | ||
|
||
@Test | ||
public void testWriteHTable() throws IOException { | ||
TsCollectionCsvFormatter x = new TsCollectionCsvFormatter(); | ||
x.setPresentation(CsvLayout.HTable); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(), List.of(), w))) | ||
.isEmpty(); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(TsData.empty("no data")), List.of("S1"), w))) | ||
.isEmpty(); | ||
|
||
assertThat(writeToString(w -> x.write(DataGenerator.BY_INDEX.listOfTsData("R0/2010-01-01T00:00:00/P1M", "R3/2010-01-01T00:00:00/P1M", "R1/2010-01-01T00:00:00/P3M"), List.of("S1", "S2", "S3"), w))) | ||
.isEqualToNormalizingNewlines( | ||
""" | ||
,2010-01-01,2010-02-01,2010-03-01 | ||
S1,,, | ||
S2,1.1,2.2,3.3 | ||
S3,,,1.1 | ||
""" | ||
); | ||
} | ||
|
||
@Test | ||
public void testWriteList() throws IOException { | ||
TsCollectionCsvFormatter x = new TsCollectionCsvFormatter(); | ||
x.setPresentation(CsvLayout.List); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(), List.of(), w))) | ||
.isEmpty(); | ||
|
||
assertThat(writeToString(w -> x.write(List.of(TsData.empty("no data")), List.of("S1"), w))) | ||
.isEqualToIgnoringNewLines("S1,1,1970,1,0"); | ||
|
||
assertThat(writeToString(w -> x.write(DataGenerator.BY_INDEX.listOfTsData("R0/2010-01-01T00:00:00/P1M", "R3/2010-01-01T00:00:00/P1M", "R1/2010-01-01T00:00:00/P3M"), List.of("S1", "S2", "S3"), w))) | ||
.isEqualToNormalizingNewlines( | ||
""" | ||
S1,12,2010,1,0 | ||
S2,12,2010,1,3,1.1,2.2,3.3 | ||
S3,4,2010,1,1,1.1 | ||
""" | ||
); | ||
} | ||
|
||
@MightBePromoted | ||
private static String writeToString(IOConsumer<? super Writer> consumer) throws IOException { | ||
StringWriter writer = new StringWriter(); | ||
consumer.acceptWithIO(writer); | ||
return writer.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.