Skip to content

Commit

Permalink
Version v1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragmaanir committed Jan 30, 2024
1 parent 0e3b336 commit 96cfb1d
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 81 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Changed dark blue in reporter to light blue
- Highlight errors headline in error list reporter
- Highlight test method in backtraces
- Use Colorize::ColorRGB for better colors
- Fix deprecated `splat/double_splat`

### 1.2.6

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🔬 microtest [![Crystal CI](https://github.com/Ragmaanir/microtest/actions/workflows/crystal.yml/badge.svg)](https://github.com/Ragmaanir/microtest/actions/workflows/crystal.yml)

### Version 1.2.6
### Version 1.2.7

A small testing framework inspired by minitest/minitest.cr.

Expand All @@ -26,7 +26,7 @@ Add this to your application's `shard.yml`:
development_dependencies:
microtest:
github: ragmaanir/microtest
version: ~> 1.2.6
version: ~> 1.2.7
```
And add this to your `spec_helper.rb`:
Expand Down
6 changes: 3 additions & 3 deletions assets/assertion_failure.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</head>
<body style="color:white; background-color:black">
<pre>
<span style="color:red;"># 1 AssertionFailureTest#assertion_failure </span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">SPEC: spec/test.cr:5</span>
<span style="filter: contrast(70%) brightness(190%);color:red;"></span> <span style="color:red;">assert</span> <span style="font-weight:bold;color:red;">(&quot;a&quot; * a) == b</span>
<span style="filter: contrast(70%) brightness(190%);color:red;"></span> &quot;aaaaa&quot;<span style="filter: contrast(70%) brightness(190%);color:dimgray;"> == </span>&quot;aaaaaa&quot;
<span style="font-weight:bold;color:#dc0000;"># 1 AssertionFailureTest#assertion_failure </span><span style="font-weight:bold;color:#c8c8c8;">SPEC: spec/test.cr:5</span>
<span style="color:#c83232;"></span> <span style="color:#c80000;">assert</span> <span style="font-weight:bold;color:#fa5050;">(&quot;a&quot; * a) == b</span>
<span style="color:#c83232;"></span> &quot;aaaaa&quot;<span style="color:#646464;"> == </span>&quot;aaaaaa&quot;



Expand Down
Binary file modified assets/assertion_failure.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 31 additions & 32 deletions assets/description_reporter.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,43 @@
<body style="color:white; background-color:black">
<pre>

<span style="text-decoration:underline;color:fuchsia;">FirstTest</span>
<span style="color:lime;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 174 ns</span> <span style="color:lime;">success</span>
<span style="color:yellow;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 17 µs</span> <span style="color:yellow;">skip this</span>
<span style="text-decoration:underline;color:#cd00cd;">FirstTest</span>
<span style="color:#00dc00;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 202 ns</span> <span style="color:#00dc00;">success</span>
<span style="color:#dcdc00;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 19 µs</span> <span style="color:#dcdc00;">skip this</span>

<span style="text-decoration:underline;color:fuchsia;">SecondTest</span>
<span style="color:red;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 14 µs</span> <span style="color:red;">first failure</span>
<span style="color:red;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 7 µs</span> <span style="color:red;">error</span>
<span style="text-decoration:underline;color:#cd00cd;">SecondTest</span>
<span style="color:#dc0000;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 20 µs</span> <span style="color:#dc0000;">first failure</span>
<span style="color:#dc0000;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 7 µs</span> <span style="color:#dc0000;">error</span>

<span style="color:yellow;">skip_this: not implemented</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> in SPEC: spec/test.cr:5</span>
<span style="color:#dcdc00;">skip_this: not implemented</span><span style="color:#646464;"> in SPEC: spec/test.cr:5</span>

<span style="color:red;"># 1 SecondTest#first_failure </span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">SPEC: spec/test.cr:5</span>
<span style="filter: contrast(70%) brightness(190%);color:red;"></span> <span style="color:red;">assert</span> <span style="font-weight:bold;color:red;">a == (b * 2)</span>
<span style="filter: contrast(70%) brightness(190%);color:red;"></span> 5<span style="filter: contrast(70%) brightness(190%);color:dimgray;"> == </span>14
<span style="font-weight:bold;color:#dc0000;"># 1 SecondTest#first_failure </span><span style="font-weight:bold;color:#c8c8c8;">SPEC: spec/test.cr:5</span>
<span style="color:#c83232;"></span> <span style="color:#c80000;">assert</span> <span style="font-weight:bold;color:#fa5050;">a == (b * 2)</span>
<span style="color:#c83232;"></span> 5<span style="color:#646464;"> == </span>14


<span style="color:red;"># 2 SecondTest#error </span>
<span style="font-weight:bold;color:#dc0000;"># 2 SecondTest#error </span><span style="font-weight:bold;color:#c8c8c8;">SPEC: spec/test.cr:5</span>
<span style="color:red;">Oh, this is wrong</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:dimgray;">CRY: /crystal/main.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:141 </span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">main</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:dimgray;">CRY: /crystal/main.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:115 </span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">main</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:dimgray;">CRY: /crystal/main.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:129 </span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">main_user_code</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">SPEC: spec/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:7 </span><span style="color:yellow;">__crystal_main</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:109 </span><span style="color:yellow;">run!</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:98 </span><span style="color:yellow;">run</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:100 </span><span style="color:yellow;">run</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/runner.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:26 </span><span style="color:yellow;">call</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:37 </span><span style="color:yellow;">run_tests</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/test_method.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:27 </span><span style="color:yellow;">call</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">SPEC: spec/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:5 </span><span style="color:yellow;">-&gt;</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:52 </span><span style="color:yellow;">run_test</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:83 </span><span style="color:yellow;">around_hooks</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">APP: src/microtest/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:56 </span><span style="color:yellow;">-&gt;</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">SPEC: spec/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:5 </span><span style="color:yellow;">-&gt;</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">SPEC: spec/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:5 </span><span style="color:yellow;">test__error</span>
<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span> <span style="filter: contrast(70%) brightness(190%);color:fuchsia;">SPEC: spec/test.cr</span><span style="filter: contrast(70%) brightness(190%);color:dimgray;">:5 </span><span style="color:yellow;">raise_an_error</span>


<span style="color:#3333FF;">Executed</span><span style="color:#3333FF;"> 4/4 </span><span style="color:#3333FF;">tests in 188µs with seed 1</span>
<span style="color:lime;">Success: 1</span>, <span style="color:yellow;">Skips: 1</span>, <span style="color:red;">Failures: 2</span>
<span style="color:#646464;"></span> <span style="color:#646464;">CRY: /crystal/main.cr</span><span style="color:#646464;">:141 </span><span style="color:#646464;">main</span>
<span style="color:#646464;"></span> <span style="color:#646464;">CRY: /crystal/main.cr</span><span style="color:#646464;">:115 </span><span style="color:#646464;">main</span>
<span style="color:#646464;"></span> <span style="color:#646464;">CRY: /crystal/main.cr</span><span style="color:#646464;">:129 </span><span style="color:#646464;">main_user_code</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest.cr</span><span style="color:#646464;">:108 </span><span style="color:#dcdc00;">run!</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest.cr</span><span style="color:#646464;">:97 </span><span style="color:#dcdc00;">run</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest.cr</span><span style="color:#646464;">:99 </span><span style="color:#dcdc00;">run</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/runner.cr</span><span style="color:#646464;">:26 </span><span style="color:#dcdc00;">call</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/test.cr</span><span style="color:#646464;">:37 </span><span style="color:#dcdc00;">run_tests</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/test_method.cr</span><span style="color:#646464;">:29 </span><span style="color:#dcdc00;">call</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">SPEC: spec/test.cr</span><span style="color:#646464;">:5 </span><span style="color:#dcdc00;">-&gt;</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/test.cr</span><span style="color:#646464;">:52 </span><span style="color:#dcdc00;">run_test</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/test.cr</span><span style="color:#646464;">:83 </span><span style="color:#dcdc00;">around_hooks</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">APP: src/microtest/test.cr</span><span style="color:#646464;">:56 </span><span style="color:#dcdc00;">-&gt;</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">SPEC: spec/test.cr</span><span style="color:#646464;">:5 </span><span style="color:#dcdc00;">-&gt;</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">SPEC: spec/test.cr</span><span style="color:#646464;">:5 </span><span style="font-weight:bold;color:#dcdc00;">test__error</span>
<span style="color:#646464;"></span> <span style="color:#dc00dc;">SPEC: spec/test.cr</span><span style="color:#646464;">:5 </span><span style="color:#dcdc00;">raise_an_error</span>


<span style="color:#5a5afa;">Executed</span><span style="color:#5a5afa;"> 4/4 </span><span style="color:#5a5afa;">tests in 200µs with seed 1</span>
<span style="color:#00dc00;">Success: 1</span>, <span style="color:#dcdc00;">Skips: 1</span>, <span style="color:#dc0000;">Failures: 2</span>


</pre>
Expand Down
Binary file modified assets/description_reporter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions assets/focus.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<body style="color:white; background-color:black">
<pre>

<span style="text-decoration:underline;color:fuchsia;">FocusTest</span>
<span style="color:lime;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 190 ns</span> <span style="color:lime;">focused</span>
<span style="color:lime;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 102 ns</span> <span style="color:lime;">focused too</span>
<span style="text-decoration:underline;color:#cd00cd;">FocusTest</span>
<span style="color:#00dc00;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 335 ns</span> <span style="color:#00dc00;">focused</span>
<span style="color:#00dc00;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;"> 144 ns</span> <span style="color:#00dc00;">focused too</span>

<span style="background-color:red;">USING FOCUS:</span> <span style="color:#3333FF;">Executed</span><span style="color:red;"> 2/3 </span><span style="color:#3333FF;">tests in 116µs with seed 1</span>
<span style="color:lime;">Success: 2</span>, Skips: 0, Failures: 0
<span style="background-color:#dc0000;">USING FOCUS:</span> <span style="color:#5a5afa;">Executed</span><span style="color:#dc0000;"> 2/3 </span><span style="color:#5a5afa;">tests in 171µs with seed 1</span>
<span style="color:#00dc00;">Success: 2</span>, Skips: 0, Failures: 0


</pre>
Expand Down
Binary file modified assets/focus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 96cfb1d

Please sign in to comment.