Skip to content

Commit

Permalink
Re-add forgotten explicit namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Aug 30, 2024
1 parent 6edcae0 commit 00062d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libraries/common/test.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ namespace Formatted {
def tryEmit(escape: String): String / Formatted =
if (do supportsEscape(escape)) escape else ""

def withEscape(text: String, colorEscape: String): String / Formatted =
def colored(text: String, colorEscape: String): String / Formatted =
tryEmit(colorEscape) ++ text ++ tryEmit(ANSI::RESET)
}

namespace Duration {
def diff(fromNanos: Int, toNanos: Int) = toNanos - fromNanos
}

def red(text: String) = text.withEscape(ANSI::RED)
def green(text: String) = text.withEscape(ANSI::GREEN)
def dim(text: String) = text.withEscape(ANSI::FAINT)
def bold(text: String) = text.withEscape(ANSI::BOLD)
def red(text: String) = Formatted::colored(text, ANSI::RED)
def green(text: String) = Formatted::colored(text, ANSI::GREEN)
def dim(text: String) = Formatted::colored(text, ANSI::FAINT)
def bold(text: String) = Formatted::colored(text, ANSI::BOLD)


interface Assertion {
Expand Down

0 comments on commit 00062d4

Please sign in to comment.