Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Jun 20, 2024
1 parent 25948b5 commit 34d26da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Data/String/cork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ string
tm_decode (string s) {
// TeXmacs encoding to verbatim
string r;
int s_N= N(s);
int s_N= N (s);
for (int i= 0; i < s_N; i++) {
if (s[i] == '<') {
int j;
Expand Down
7 changes: 7 additions & 0 deletions tests/Data/String/cork_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ TEST_CASE ("tm_var_encode") {
string_eq (tm_encode (""), "");
}

TEST_CASE ("tm_decode") {
string_eq (tm_decode ("<less><gtr>"), "<>");
string_eq (tm_decode ("<#ABCD>"), "<#ABCD>");
string_eq (tm_decode ("abc"), "abc");
string_eq (tm_decode (""), "");
}

TEST_CASE ("tm_length") {
string_eq (tm_string_length (""), 0);
string_eq (tm_string_length ("<#ABCD>"), 1);
Expand Down

0 comments on commit 34d26da

Please sign in to comment.