<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'wirp/network_configuration'

describe Wirp::NetworkConfiguration do
  before do
    @nc = Wirp::NetworkConfiguration.new
  end

  it "should respond to the right things" do
    [:router_addr, :netmask, :network_name, :network_address, 
     :broadcast_address, :first_usable_ip, :last_usable_ip].each do |method|
      @nc.should respond_to(method)
    end
  end

  it "should calculate network addresses correctly" do
    @nc.router_addr = "1.2.3.4"
    @nc.netmask     = "255.255.255.0"
    @nc.network_address.should == "1.2.3.0"
  end
end
<commit_msg>test broadcast address calculation<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'wirp/network_configuration'

describe Wirp::NetworkConfiguration do
  before do
    @nc = Wirp::NetworkConfiguration.new
  end

  it "should respond to the right things" do
    [:router_addr, :netmask, :network_name, :network_address, 
     :broadcast_address, :first_usable_ip, :last_usable_ip].each do |method|
      @nc.should respond_to(method)
    end
  end

  it "should calculate network addresses correctly" do
    @nc.router_addr = "1.2.3.4"
    @nc.netmask     = "255.255.255.0"
    @nc.network_address.should == "1.2.3.0"
  end

  it "should calculate broadcast addresses correctly" do
    @nc.router_addr = "1.2.3.4"
    @nc.netmask     = "255.255.255.0"
    @nc.broadcast_address.should == "172.16.17.32"
  end
end

{'fraction_non_alphanumeric': 0.11898395721925134, 'fraction_numerical': 0.03943850267379679, 'mean_word_length': 3.7827476038338657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 9, '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': '7538437', 'n_tokens_mistral': 551, 'n_tokens_neox': 508, 'n_words': 115}