Skip to content

Instantly share code, notes, and snippets.

View zenspider's full-sized avatar
🌈
It's complicated?

Ryan Davis zenspider

🌈
It's complicated?
View GitHub Profile
10422 % ruby -Ilib kaboom.rb
Run options: --seed 39367
# Running:
E
Finished in 0.094671s, 10.5629 runs/s, 0.0000 assertions/s.
1) Error:
diff -r old/lib/minitest.rb new/lib/minitest.rb
--- old/lib/minitest.rb
+++ new/lib/minitest.rb
@@ -99,12 +99,10 @@
end
def self.load_plugins # :nodoc:
- return unless self.extensions.empty?
+ return unless defined? Gem
# NOTE: ironically, this breaks if using Werror + frozen-string-literals
def summary # :nodoc:
extra = ""
extra = "\n\nYou have skipped tests. Run with --verbose for details." if
results.any?(&:skipped?) unless
options[:verbose] or options[:show_skips] or ENV["MT_NO_SKIP_MSG"]
extra.prepend ", %d warnings" % [warnings] if options[:Werror]
diff -r old/lib/minitest/rake_reporter.rb new/lib/minitest/rake_reporter.rb
--- old/lib/minitest/rake_reporter.rb
+++ new/lib/minitest/rake_reporter.rb
@@ -2,9 +2,16 @@
module Minitest
class RakeReporter < SprintReporter
+ attr_accessor :name
+
+ def initialize name = nil
10579 $ N=100000 ./minitest_multiversion.rb -q
1.1.0 = 0.121956s 0.22s 819967.86 rps
1.2.1 = 0.183326s 0.29s 545476.36 rps
1.3.1 = 0.245228s 0.35s 407783.78 rps
1.4.2 = 0.310824s 0.41s 321725.48 rps
...
2.12.1 = 0.404904s 0.51s 246972.12 rps
3.0.1 = 0.405681s 0.51s 246499.10 rps
...
3.5.0 = 0.405145s 0.51s 246825.21 rps
library typ size time wall mrss
null pos 10000 0.000000s 0.03s 18.83M
null neg 10000 0.000000s 0.03s 22.69M
minitest pos 10000 0.045201s 0.09s 24.85M
minitest neg 10000 0.086590s 0.27s 78.61M
minitest-q pos 10000 0.030654s 0.08s 26.20M
minitest-q neg 10000 0.061227s 0.25s 77.82M
test-unit pos 10000 0.105704s 0.21s 34.70M
test-unit neg 10000 4.008822s 4.12s 46.19M
--- //src/minitest/dev/lib/minitest.rb 2024-08-14 03:41:56.000000000 -0700
+++ /Users/ryan/Work/p4/zss/src/minitest/dev/lib/minitest.rb 2024-08-14 03:41:56.000000000 -0700
@@ -416,7 +416,7 @@
t0 = name = nil
- handler = lambda do
+ @_info_handler = lambda do
unless reporter.passed? then
warn "Current results:"
class ZenwebBuilder < WEBrick::HTTPServlet::FileHandler
@@semaphore = Mutex.new
def service req, res
@@site ||= @@semaphore.synchronize { website }
url = req.path
target_path = File.join(".site", url)
target_path = File.join target_path, "index.html" if
diff -r old/lib/minitest.rb new/lib/minitest.rb
--- old/lib/minitest.rb
+++ new/lib/minitest.rb
@@ -647,7 +647,7 @@
##
# The location of the test method.
- attr_accessor :source_location
+ attr_writer :source_location
diff -r old/lib/minitest/assertions.rb new/lib/minitest/assertions.rb
--- old/lib/minitest/assertions.rb
+++ new/lib/minitest/assertions.rb
@@ -212,8 +212,12 @@
# See also: Minitest::Assertions.diff
def assert_equal exp, act, msg = nil
- msg = message(msg, E) { diff exp, act }
- result = assert exp == act, msg
+ begin