Skip to content

Commit 10a006b

Browse files
feat(#3840): add a unit test for TrStepped
1 parent 892a6db commit 10a006b

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

eo-parser/src/main/java/org/eolang/parser/TrStepped.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.cactoos.text.TextOf;
3838

3939
/**
40-
* Trains that adds sheet names that were processed.
40+
* Train that adds sheet names that were processed.
4141
*
4242
* @since 0.1
4343
*/
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2016-2025 Objectionary.com
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included
14+
* in all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package org.eolang.parser;
25+
26+
import com.jcabi.matchers.XhtmlMatchers;
27+
import com.jcabi.xml.XML;
28+
import com.jcabi.xml.XMLDocument;
29+
import com.yegor256.xsline.Shift;
30+
import com.yegor256.xsline.StClasspath;
31+
import com.yegor256.xsline.TrDefault;
32+
import com.yegor256.xsline.Xsline;
33+
import org.hamcrest.MatcherAssert;
34+
import org.junit.jupiter.api.Test;
35+
36+
/**
37+
* Test cases for {@link TrStepped}.
38+
*
39+
* @since 0.51
40+
*/
41+
final class TrSteppedTest {
42+
43+
@Test
44+
void addsSheetName() {
45+
MatcherAssert.assertThat(
46+
"We expect the sheet name to be added",
47+
new Xsline(
48+
new TrStepped(
49+
new TrDefault<Shift>().with(
50+
new StClasspath("/org/eolang/parser/print/wrap-data.xsl"))
51+
)).pass(
52+
new XMLDocument("<program><language>EO</language></program>")
53+
).toString(),
54+
XhtmlMatchers.hasXPath("/program/sheets/sheet[text()='wrap-data']")
55+
);
56+
}
57+
58+
59+
}

0 commit comments

Comments
 (0)