File: test_timelimitedqueue.rb

package info (click to toggle)
mikutter 5.0.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,700 kB
  • sloc: ruby: 21,307; sh: 181; makefile: 19
file content (28 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-

require 'test/unit'
require File.expand_path(File.join('..', 'timelimitedqueue'))

class TC_TimeLimitedQueue < Test::Unit::TestCase
  def setup
    Thread.abort_on_exception = true
  end

  # def teardown
  # end

  def test_output
    tlq = TimeLimitedQueue.new(10, 1){ |v| p v }
    100.times{ |n|
      tlq.push(n) }
    assert_equal(tlq.thread.group, TimeLimitedQueue::TLQGroup)
    # sleep(1)
  end

end
# >> Loaded suite -
# >> Started
# >> .
# >> Finished in 0.001979 seconds.
# >> 
# >> 1 tests, 1 assertions, 0 failures, 0 errors