Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added text effects #59

Merged
merged 3 commits into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/com/diogonunes/jcolor/Attribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ public static Attribute HIDDEN() {
public static Attribute STRIKETHROUGH() {
return new SimpleAttribute("9");
}

public static Attribute FRAMED() {
return new SimpleAttribute("51");
}

public static Attribute ENCIRCLED() {
return new SimpleAttribute("52");
}

public static Attribute OVERLINED() {
return new SimpleAttribute("53");
}

// Colors (foreground)

Expand Down
39 changes: 39 additions & 0 deletions src/test/java/com/diogonunes/jcolor/tests/unit/TestAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,45 @@ public void Attribute_AnsiCode_Strikethrough() {
assertThat(code, equalTo(expectedAnsiCode));
}

@Test
public void Attribute_AnsiCode_Framed() {
// ARRANGE
Attribute attribute = Attribute.FRAMED();

// ACT
String code = attribute.toString();

// ASSERT
String expectedAnsiCode = "51";
assertThat(code, equalTo(expectedAnsiCode));
}

@Test
public void Attribute_AnsiCode_Encircled() {
// ARRANGE
Attribute attribute = Attribute.ENCIRCLED();

// ACT
String code = attribute.toString();

// ASSERT
String expectedAnsiCode = "52";
assertThat(code, equalTo(expectedAnsiCode));
}

@Test
public void Attribute_AnsiCode_Overlined() {
// ARRANGE
Attribute attribute = Attribute.OVERLINED();

// ACT
String code = attribute.toString();

// ASSERT
String expectedAnsiCode = "53";
assertThat(code, equalTo(expectedAnsiCode));
}

// Colors (foreground)

@Test
Expand Down