<commit_before>require File.expand_path 'test_helper', File.dirname(__FILE__)

class TestArduinoFirmata < MiniTest::Unit::TestCase

  def setup
    @arduino = ArduinoFirmata.connect ENV['ARDUINO']
  end

  def test_arduino
    assert @arduino.version > '2.0'
    @arduino.close
  end

  def test_analog_read
    0.upto(5).each do |pin|
      assert 0 < @arduino.analog_read(pin)
    end
    @arduino.close
  end
end
<commit_msg>fix analog_read test<commit_after>require File.expand_path 'test_helper', File.dirname(__FILE__)

class TestArduinoFirmata < MiniTest::Unit::TestCase

  def setup
    @arduino = ArduinoFirmata.connect ENV['ARDUINO']
  end

  def test_arduino
    assert @arduino.version > '2.0'
    @arduino.close
  end

  def test_analog_read
    0.upto(5).each do |pin|
      ain = @arduino.analog_read pin
      assert 0 <= ain and ain < 1024
    end
    @arduino.close
  end
end

{'fraction_non_alphanumeric': 0.09731543624161074, 'fraction_numerical': 0.015659955257270694, 'mean_word_length': 3.4527363184079602, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1335403', 'n_tokens_mistral': 350, 'n_tokens_neox': 331, 'n_words': 72}