Skip to content

Commit a87b843

Browse files
committed
clock_sym_and_val
1 parent 760342c commit a87b843

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/rdoc/rdoc_comment_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def test_extract_call_linear_performance
192192
def test_clock_res
193193
clockres = %w[
194194
CLOCK_THREAD_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID
195-
CLOCK_MONOTONIC FOO
195+
CLOCK_MONOTONIC
196196
].map do |c|
197197
begin
198198
clk = Process.const_get c
@@ -204,6 +204,16 @@ def test_clock_res
204204
assert_equal("clocktime", clockres.inspect)
205205
end
206206

207+
def test_clock_sym_val
208+
codes = %w[
209+
Process.clock_getres(Process::CLOCK_MONOTONIC)
210+
Process.clock_getres(:CLOCK_MONOTONIC)
211+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
212+
Process.clock_gettime(:CLOCK_MONOTONIC)
213+
]
214+
assert_equal('result', codes.to_h{|code| [code, eval(code)]})
215+
end
216+
207217
def test_clock_actual_res
208218
clockres = %w[
209219
CLOCK_THREAD_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID

0 commit comments

Comments
 (0)