mega-sharp-tool 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/mega-sharp-tool.gemspec +12 -0
  3. data/minitest-6.0.6/History.rdoc +1860 -0
  4. data/minitest-6.0.6/Manifest.txt +41 -0
  5. data/minitest-6.0.6/README.rdoc +763 -0
  6. data/minitest-6.0.6/Rakefile +89 -0
  7. data/minitest-6.0.6/bin/minitest +5 -0
  8. data/minitest-6.0.6/design_rationale.rb +54 -0
  9. data/minitest-6.0.6/lib/hoe/minitest.rb +30 -0
  10. data/minitest-6.0.6/lib/minitest/assertions.rb +821 -0
  11. data/minitest-6.0.6/lib/minitest/autorun.rb +5 -0
  12. data/minitest-6.0.6/lib/minitest/benchmark.rb +452 -0
  13. data/minitest-6.0.6/lib/minitest/bisect.rb +304 -0
  14. data/minitest-6.0.6/lib/minitest/complete.rb +56 -0
  15. data/minitest-6.0.6/lib/minitest/compress.rb +94 -0
  16. data/minitest-6.0.6/lib/minitest/error_on_warning.rb +11 -0
  17. data/minitest-6.0.6/lib/minitest/expectations.rb +321 -0
  18. data/minitest-6.0.6/lib/minitest/find_minimal_combination.rb +127 -0
  19. data/minitest-6.0.6/lib/minitest/hell.rb +11 -0
  20. data/minitest-6.0.6/lib/minitest/manual_plugins.rb +4 -0
  21. data/minitest-6.0.6/lib/minitest/parallel.rb +72 -0
  22. data/minitest-6.0.6/lib/minitest/path_expander.rb +432 -0
  23. data/minitest-6.0.6/lib/minitest/pride.rb +4 -0
  24. data/minitest-6.0.6/lib/minitest/pride_plugin.rb +135 -0
  25. data/minitest-6.0.6/lib/minitest/server.rb +49 -0
  26. data/minitest-6.0.6/lib/minitest/server_plugin.rb +88 -0
  27. data/minitest-6.0.6/lib/minitest/spec.rb +324 -0
  28. data/minitest-6.0.6/lib/minitest/sprint.rb +105 -0
  29. data/minitest-6.0.6/lib/minitest/sprint_plugin.rb +39 -0
  30. data/minitest-6.0.6/lib/minitest/test.rb +232 -0
  31. data/minitest-6.0.6/lib/minitest/test_task.rb +331 -0
  32. data/minitest-6.0.6/lib/minitest.rb +1232 -0
  33. data/minitest-6.0.6/test/minitest/metametameta.rb +150 -0
  34. data/minitest-6.0.6/test/minitest/test_bisect.rb +249 -0
  35. data/minitest-6.0.6/test/minitest/test_find_minimal_combination.rb +138 -0
  36. data/minitest-6.0.6/test/minitest/test_minitest_assertions.rb +1729 -0
  37. data/minitest-6.0.6/test/minitest/test_minitest_benchmark.rb +151 -0
  38. data/minitest-6.0.6/test/minitest/test_minitest_reporter.rb +437 -0
  39. data/minitest-6.0.6/test/minitest/test_minitest_spec.rb +1095 -0
  40. data/minitest-6.0.6/test/minitest/test_minitest_test.rb +1295 -0
  41. data/minitest-6.0.6/test/minitest/test_minitest_test_task.rb +57 -0
  42. data/minitest-6.0.6/test/minitest/test_path_expander.rb +229 -0
  43. data/minitest-6.0.6/test/minitest/test_server.rb +146 -0
  44. metadata +83 -0
@@ -0,0 +1,57 @@
1
+ require "minitest/autorun"
2
+
3
+ begin
4
+ require "hoe"
5
+ rescue LoadError => e
6
+ warn e.message
7
+ return
8
+ end
9
+
10
+ require "minitest/test_task"
11
+
12
+ Hoe.load_plugins # make sure Hoe::Test is loaded
13
+
14
+ class TestHoeTest < Minitest::Test
15
+ PATH = "test/minitest/test_minitest_test_task.rb"
16
+
17
+ def util_cmd_string *prelude_framework
18
+ mt_path = %w[lib test .].join File::PATH_SEPARATOR
19
+ mt_expected = "-I%s -w -e '%srequire %p' -- "
20
+
21
+ mt_expected % [mt_path, prelude_framework.join("; "), PATH]
22
+ end
23
+
24
+ def util_exp_cmd
25
+ @tester.make_test_cmd.sub(/ -- .+/, " -- ")
26
+ end
27
+
28
+ def test_make_test_cmd_for_minitest
29
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
30
+
31
+ require "minitest/test_task"
32
+
33
+ framework = %(require "minitest/autorun"; )
34
+
35
+ @tester = Minitest::TestTask.create :test do |t|
36
+ t.test_globs = [PATH]
37
+ end
38
+
39
+ assert_equal util_cmd_string(framework), util_exp_cmd
40
+ end
41
+
42
+ def test_make_test_cmd_for_minitest_prelude
43
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
44
+
45
+ require "minitest/test_task"
46
+
47
+ prelude = %(require "other/file")
48
+ framework = %(require "minitest/autorun"; )
49
+
50
+ @tester = Minitest::TestTask.create :test do |t|
51
+ t.test_prelude = prelude
52
+ t.test_globs = [PATH]
53
+ end
54
+
55
+ assert_equal util_cmd_string(prelude, framework), util_exp_cmd
56
+ end
57
+ end
@@ -0,0 +1,229 @@
1
+ require "minitest/autorun"
2
+ require "minitest/path_expander"
3
+
4
+ class TestPathExpander < Minitest::Test
5
+ attr_accessor :args
6
+ attr_accessor :expander
7
+
8
+ MT_VPE = Minitest::VendoredPathExpander
9
+
10
+ def setup
11
+ super
12
+
13
+ self.args = []
14
+
15
+ self.expander = MT_VPE.new args, "*.rb"
16
+
17
+ @pe_tmp_path = "test/pe_tmp"
18
+ @pe_tst_path = "test/pe_tmp/test"
19
+
20
+ @orig_pwd = Dir.pwd
21
+ FileUtils.mkdir_p @pe_tst_path
22
+ FileUtils.touch ["#{@pe_tst_path}/test_path_expander.rb", "#{@pe_tst_path}/test_bad.rb"]
23
+ Dir.chdir @pe_tmp_path
24
+ end
25
+
26
+ def teardown
27
+ super
28
+
29
+ Dir.chdir @orig_pwd
30
+
31
+ FileUtils.rm_rf @pe_tmp_path
32
+ end
33
+
34
+ def assert_filter_files exp, filter, files = %w[test/dog_and_cat.rb]
35
+ ignore = StringIO.new filter
36
+ act = expander.filter_files files, ignore
37
+ assert_equal exp, act
38
+ end
39
+
40
+ def assert_filter_files_absolute_paths exp, filter, files = [File.join(Dir.pwd, 'test/dog_and_cat.rb')]
41
+ assert_filter_files exp, filter, files
42
+ end
43
+
44
+ def assert_process_args exp_files, exp_args, *args
45
+ expander.args.concat args
46
+
47
+ assert_equal [exp_files.sort, exp_args], expander.process_args
48
+ end
49
+
50
+ def test_expand_dirs_to_files
51
+ exp = %w[test/test_bad.rb test/test_path_expander.rb]
52
+
53
+ assert_equal exp, expander.expand_dirs_to_files("test")
54
+ assert_equal %w[Rakefile], expander.expand_dirs_to_files("Rakefile")
55
+ end
56
+
57
+ def test_expand_dirs_to_files__sorting
58
+ exp = %w[test/test_bad.rb test/test_path_expander.rb]
59
+ input = %w[test/test_path_expander.rb test/test_bad.rb]
60
+
61
+ assert_equal exp, expander.expand_dirs_to_files(*input)
62
+ assert_equal %w[Rakefile], expander.expand_dirs_to_files("Rakefile")
63
+ end
64
+
65
+ def test_expand_dirs_to_files__leading_dot
66
+ exp = %w[test/test_bad.rb test/test_path_expander.rb]
67
+
68
+ assert_equal exp, expander.expand_dirs_to_files("./test")
69
+ end
70
+
71
+ def test_filter_files_dir
72
+ assert_filter_files [], "test/"
73
+ assert_filter_files_absolute_paths [], "test/"
74
+ end
75
+
76
+ def test_filter_files_files
77
+ example = %w[test/file.rb test/sub/file.rb top/test/perf.rb]
78
+ example_absolute_paths = example.map { |e| File.join(Dir.pwd, e) }
79
+
80
+ assert_filter_files [], "test/*.rb"
81
+
82
+ assert_filter_files example[1..-1], "test/*.rb", example
83
+
84
+ assert_filter_files_absolute_paths [], "test/*.rb"
85
+
86
+ assert_filter_files_absolute_paths example_absolute_paths[1..-1], "test/*.rb", example_absolute_paths
87
+ end
88
+
89
+ def test_filter_files_glob
90
+ assert_filter_files [], "test*"
91
+ assert_filter_files [], "test*", ["test/lib/woot.rb"]
92
+ assert_filter_files [], "*.rb"
93
+ assert_filter_files [], "*dog*.rb"
94
+
95
+ assert_filter_files_absolute_paths [], "test*"
96
+ assert_filter_files_absolute_paths [], "test*", [File.join(Dir.pwd, "test/lib/woot.rb")]
97
+ assert_filter_files_absolute_paths [], "*.rb"
98
+ assert_filter_files_absolute_paths [], "*dog*.rb"
99
+ end
100
+
101
+ def test_filter_files_glob_miss
102
+ miss = %w[test/dog_and_cat.rb]
103
+ miss_absolute = [File.join(Dir.pwd, 'test/dog_and_cat.rb')]
104
+
105
+ assert_filter_files miss, "test"
106
+ assert_filter_files miss, "nope"
107
+
108
+ assert_filter_files_absolute_paths miss_absolute, "test"
109
+ assert_filter_files_absolute_paths miss_absolute, "nope"
110
+ end
111
+
112
+ def test_filter_files__ignore_file
113
+ files = expander.expand_dirs_to_files "test"
114
+
115
+ File.write ".mtignore", "test/*.rb"
116
+
117
+ act = expander.filter_files files, ".mtignore"
118
+
119
+ assert_equal [], act
120
+ end
121
+
122
+ def test_process
123
+ self.args.concat %w[test --seed 42]
124
+
125
+ act = expander.process
126
+
127
+ assert_kind_of Enumerator, act
128
+ assert_equal %w[test/test_bad.rb test/test_path_expander.rb], act.to_a
129
+ assert_equal %w[--seed 42], expander.args
130
+ assert_equal %w[--seed 42], args # affected our original array (eg, ARGV)
131
+ end
132
+
133
+ def test_process__block
134
+ self.args.concat %w[test --seed 42]
135
+
136
+ act = []
137
+ result = expander.process { |x| act << x }
138
+
139
+ assert_same expander, result
140
+ assert_equal %w[test/test_bad.rb test/test_path_expander.rb], act.to_a
141
+ assert_equal %w[--seed 42], expander.args
142
+ assert_equal %w[--seed 42], args # affected our original array (eg, ARGV)
143
+ end
144
+
145
+ def with_tempfile *lines
146
+ require "tempfile"
147
+
148
+ Tempfile.open("tmp") do |f|
149
+ f.puts lines
150
+ f.flush
151
+ f.rewind
152
+
153
+ yield f
154
+ end
155
+ end
156
+
157
+ def test_process_args_at
158
+ with_tempfile %w[test -test/test_bad.rb --seed 24] do |f|
159
+ assert_process_args(%w[test/test_path_expander.rb],
160
+ %w[--seed 24],
161
+ "@#{f.path}")
162
+ end
163
+ end
164
+
165
+ def test_process_args_dash_dir
166
+ assert_process_args(%w[],
167
+ %w[],
168
+ "test", "-test")
169
+ end
170
+
171
+ def test_process_args_dash_file
172
+ assert_process_args(%w[test/test_path_expander.rb],
173
+ %w[],
174
+ "test", "-test/test_bad.rb")
175
+
176
+ end
177
+
178
+ def test_process_args_dash_other
179
+ assert_process_args(%w[],
180
+ %w[--verbose],
181
+ "--verbose")
182
+ end
183
+
184
+ def test_process_args_dir
185
+ assert_process_args(%w[test/test_bad.rb test/test_path_expander.rb],
186
+ %w[],
187
+ "test")
188
+ end
189
+
190
+ def test_process_args_file
191
+ assert_process_args(%w[test/test_path_expander.rb],
192
+ %w[],
193
+ "test/test_path_expander.rb")
194
+ end
195
+
196
+ def test_process_args_other
197
+ assert_process_args(%w[],
198
+ %w[42],
199
+ "42")
200
+ end
201
+
202
+ def test_process_args_root
203
+ assert_process_args(%w[],
204
+ %w[-n /./],
205
+ "-n",
206
+ "/./")
207
+ end
208
+
209
+ def test_process_args_no_files
210
+ self.expander = MT_VPE.new args, "*.rb", "test" # extra test default
211
+
212
+ assert_process_args(%w[test/test_bad.rb test/test_path_expander.rb],
213
+ %w[-v],
214
+ "-v")
215
+ end
216
+
217
+ def test_process_args_dash
218
+ assert_process_args(%w[-],
219
+ %w[-v],
220
+ "-", "-v")
221
+ end
222
+
223
+ def test_process_flags
224
+ exp = %w[a b c]
225
+ act = expander.process_flags %w[a b c]
226
+
227
+ assert_equal exp, act
228
+ end
229
+ end
@@ -0,0 +1,146 @@
1
+ require "minitest/autorun"
2
+ require_relative "../../lib/minitest/server"
3
+ require_relative "../../lib/minitest/server_plugin"
4
+
5
+ class BogoTests < Minitest::Test
6
+ def pass_test
7
+ assert true
8
+ end
9
+
10
+ def fail_test
11
+ assert false, "fail"
12
+ end
13
+
14
+ def error_test
15
+ raise "error"
16
+ end
17
+
18
+ def unmarshalable_ivar_test
19
+ raise "error"
20
+ rescue => e
21
+ e.instance_variable_set :@binding, binding
22
+ raise
23
+ end
24
+
25
+ def unmarshalable_class_test
26
+ exc = Class.new RuntimeError
27
+ raise exc, "error"
28
+ rescue => e
29
+ e.instance_variable_set :@binding, binding
30
+ raise
31
+ end
32
+
33
+ def wtf_test
34
+ assert false, "wtf"
35
+ rescue Minitest::Assertion => e
36
+ e.instance_variable_set :@proc, proc { 42 }
37
+ raise e
38
+ end
39
+ end
40
+
41
+ class TestServerReporter < Minitest::ServerReporter
42
+ def record o
43
+ super
44
+
45
+ Marshal.dump o
46
+ end
47
+ end
48
+
49
+ class Client
50
+ def run pid, type
51
+ reporter = TestServerReporter.new pid
52
+
53
+ unless Minitest.respond_to? :run_one_method then # MT6
54
+ BogoTests.run BogoTests, "#{type}_test", reporter
55
+ else
56
+ reporter.start
57
+ reporter.record Minitest.run_one_method(BogoTests, "#{type}_test")
58
+ end
59
+ end
60
+ end
61
+
62
+ class Server
63
+ attr_accessor :results
64
+
65
+ def self.run type = nil
66
+ s = self.new
67
+ s.run type
68
+ s.results
69
+ end
70
+
71
+ def run type = nil
72
+ Minitest::Server.run self
73
+
74
+ Client.new.run $$, type
75
+ ensure
76
+ Minitest::Server.stop
77
+ end
78
+
79
+ def minitest_start
80
+ # do nothing
81
+ end
82
+
83
+ def minitest_result(*vals)
84
+ self.results = vals
85
+ end
86
+ end
87
+
88
+ class ServerTest < Minitest::Test
89
+ def test_pass
90
+ assert_run "pass", [], 1
91
+ end
92
+
93
+ def test_fail
94
+ assert_run "fail", ["fail"], 1
95
+ end
96
+
97
+ FILE = __FILE__.delete_prefix "#{Dir.pwd}/"
98
+
99
+ def test_error
100
+ msg = <<~EOM.chomp
101
+ RuntimeError: error
102
+ #{FILE}:##:in `error_test'
103
+ EOM
104
+
105
+ assert_run "error", [msg], 0
106
+ end
107
+
108
+ def test_error_unmarshalable__ivar
109
+ msg = <<~EOM.chomp
110
+ RuntimeError: error
111
+ #{FILE}:##:in `unmarshalable_ivar_test'
112
+ EOM
113
+
114
+ assert_run "unmarshalable_ivar", [msg], 0
115
+ end
116
+
117
+ def test_error_unmarshalable__class
118
+ msg = <<~EOM.chomp
119
+ RuntimeError: Neutered Exception #<Class:0xXXXXXX>: error
120
+ #{FILE}:##:in `unmarshalable_class_test'
121
+ EOM
122
+
123
+ assert_run "unmarshalable_class", [msg], 0
124
+ end
125
+
126
+ def test_wtf
127
+ assert_run "wtf", ["wtf"], 1
128
+ end
129
+
130
+ def assert_run type, e, n
131
+ e[0] = e[0].sub "`", "'BogoTests#" if RUBY_VERSION > "3.4" if e[0]
132
+
133
+ # client.minitest_result file, klass, method, fails, assertions, time
134
+ f, k, m, (msg,), a, _time = Server.run type
135
+
136
+ msg &&= msg
137
+ .message
138
+ .gsub(/0x\h+/, "0xXXXXXX")
139
+ .gsub(/:\d{2,}/, ":##")
140
+
141
+ act = [f, k, m, [msg].compact, a, 0]
142
+ exp = ["test/minitest/test_server.rb", "BogoTests", "#{type}_test", e, n, 0]
143
+
144
+ assert_equal exp, act
145
+ end
146
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mega-sharp-tool
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrey78
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2026-07-06 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: University research based on minitest
13
+ email:
14
+ - cakoc614@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - mega-sharp-tool.gemspec
20
+ - minitest-6.0.6/History.rdoc
21
+ - minitest-6.0.6/Manifest.txt
22
+ - minitest-6.0.6/README.rdoc
23
+ - minitest-6.0.6/Rakefile
24
+ - minitest-6.0.6/bin/minitest
25
+ - minitest-6.0.6/design_rationale.rb
26
+ - minitest-6.0.6/lib/hoe/minitest.rb
27
+ - minitest-6.0.6/lib/minitest.rb
28
+ - minitest-6.0.6/lib/minitest/assertions.rb
29
+ - minitest-6.0.6/lib/minitest/autorun.rb
30
+ - minitest-6.0.6/lib/minitest/benchmark.rb
31
+ - minitest-6.0.6/lib/minitest/bisect.rb
32
+ - minitest-6.0.6/lib/minitest/complete.rb
33
+ - minitest-6.0.6/lib/minitest/compress.rb
34
+ - minitest-6.0.6/lib/minitest/error_on_warning.rb
35
+ - minitest-6.0.6/lib/minitest/expectations.rb
36
+ - minitest-6.0.6/lib/minitest/find_minimal_combination.rb
37
+ - minitest-6.0.6/lib/minitest/hell.rb
38
+ - minitest-6.0.6/lib/minitest/manual_plugins.rb
39
+ - minitest-6.0.6/lib/minitest/parallel.rb
40
+ - minitest-6.0.6/lib/minitest/path_expander.rb
41
+ - minitest-6.0.6/lib/minitest/pride.rb
42
+ - minitest-6.0.6/lib/minitest/pride_plugin.rb
43
+ - minitest-6.0.6/lib/minitest/server.rb
44
+ - minitest-6.0.6/lib/minitest/server_plugin.rb
45
+ - minitest-6.0.6/lib/minitest/spec.rb
46
+ - minitest-6.0.6/lib/minitest/sprint.rb
47
+ - minitest-6.0.6/lib/minitest/sprint_plugin.rb
48
+ - minitest-6.0.6/lib/minitest/test.rb
49
+ - minitest-6.0.6/lib/minitest/test_task.rb
50
+ - minitest-6.0.6/test/minitest/metametameta.rb
51
+ - minitest-6.0.6/test/minitest/test_bisect.rb
52
+ - minitest-6.0.6/test/minitest/test_find_minimal_combination.rb
53
+ - minitest-6.0.6/test/minitest/test_minitest_assertions.rb
54
+ - minitest-6.0.6/test/minitest/test_minitest_benchmark.rb
55
+ - minitest-6.0.6/test/minitest/test_minitest_reporter.rb
56
+ - minitest-6.0.6/test/minitest/test_minitest_spec.rb
57
+ - minitest-6.0.6/test/minitest/test_minitest_test.rb
58
+ - minitest-6.0.6/test/minitest/test_minitest_test_task.rb
59
+ - minitest-6.0.6/test/minitest/test_path_expander.rb
60
+ - minitest-6.0.6/test/minitest/test_server.rb
61
+ homepage: https://rubygems.org/profiles/Andrey78
62
+ licenses:
63
+ - MIT
64
+ metadata:
65
+ source_code_uri: https://github.com/Andrey78/mega-sharp-tool
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.6.2
81
+ specification_version: 4
82
+ summary: Research test
83
+ test_files: []