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

Test runner reports failing tests as passed if actual or expected contains ansi color codes #2973

Closed
bobisageek opened this issue Nov 1, 2024 · 2 comments
Labels
bug Marks issues describing bugs released-eap Marks issues which have had the fixes released in an EAP build
Milestone

Comments

@bobisageek
Copy link

Problem Statement

Using the test runner, a test that has failed is reported as passing if the actual or expected values are strings with ansi color codes in them.

Repro

I have this namespace in a scratch project using deps.edn:

(ns cursive-colors-test
  (:require [clojure.test :refer [deftest is]]))


(defn red [s]
  (str "\u001b[31m" s "\u001b[0m"))

(deftest no-coloring
  (is (= "hi" "hello")))

(deftest color-in-both
  (is (= (red "hi") (red "hello"))))

(deftest color-in-expected
  (is (= (red "hi") "hello")))

(deftest color-in-actual
  (is (= "hi" (red "hello"))))

Executing these tests using run-tests reports that all 4 tests fail (as they should). Executing these tests using the test runner (i.e. by clicking the gutter icon to run tests in the NS) indicates that the tests involving color in the strings passed.
image

The console output appears to somewhat indicate that the tests failed:
image
... but perhaps that data structure isn't being read/interpreted correctly.

Context

IntelliJ version

IntelliJ IDEA 2024.2.2 (Ultimate Edition)
Build #IU-242.22855.74, built on September 18, 2024

Cursive Version

1.14.0-eap1-2024.2

@cursive-ide cursive-ide added this to the 1.14 milestone Nov 13, 2024
@cursive-ide
Copy link
Owner

This seemed to break the IntelliJ test reporter somehow, you're right that the messages were printed but I'm not sure why they weren't interpreted correctly. Anyway, fixed:
Screenshot 2024-12-02 at 21 05 45

@cursive-ide cursive-ide added the bug Marks issues describing bugs label Dec 10, 2024
@cursive-ide cursive-ide modified the milestones: 1.14, 1.14.1-eap1 Dec 10, 2024
@cursive-ide
Copy link
Owner

Fix released in 1.14.1-eap1 on 2024-12-11.

@cursive-ide cursive-ide added the released-eap Marks issues which have had the fixes released in an EAP build label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released-eap Marks issues which have had the fixes released in an EAP build
Projects
None yet
Development

No branches or pull requests

2 participants