Sha256: c2e2ae57181d70c6776ca9fcaf617a46d6395477f34c5c2307eaec89961b2d8f

Contents?: true

Size: 1.38 KB

Versions: 21

Compression:

Stored size: 1.38 KB

Contents

# Copyright (C) 2018  Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

class ColumnCacheTest < Test::Unit::TestCase
  include GroongaTestUtils

  def setup
    setup_database

    setup_users_table
  end

  def setup_users_table
    Groonga::Schema.define do |schema|
      schema.create_table("Users", :type => :hash) do |table|
        table.integer32("age")
      end
    end

    @users = context["Users"]
    @users.add("alice", :age => 9)
    @users.add("bob",   :age => 19)
    @users.add("chris", :age => 29)

    @age = @users.column("age")
  end

  def test_array_reference
    Groonga::ColumnCache.open(@age) do |column_cache|
      assert_equal(@users.collect(&:age),
                   @users.collect {|user| column_cache[user]})
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rroonga-12.1.0 test/test-column-cache.rb
rroonga-12.0.8 test/test-column-cache.rb
rroonga-12.0.2 test/test-column-cache.rb
rroonga-12.0.0 test/test-column-cache.rb
rroonga-11.0.6 test/test-column-cache.rb
rroonga-11.0.0 test/test-column-cache.rb
rroonga-10.0.6 test/test-column-cache.rb
rroonga-10.0.2 test/test-column-cache.rb
rroonga-10.0.1 test/test-column-cache.rb
rroonga-9.0.7-x64-mingw32 test/test-column-cache.rb
rroonga-9.0.7-x86-mingw32 test/test-column-cache.rb
rroonga-9.0.7 test/test-column-cache.rb
rroonga-9.0.3-x64-mingw32 test/test-column-cache.rb
rroonga-9.0.3-x86-mingw32 test/test-column-cache.rb
rroonga-9.0.3 test/test-column-cache.rb
rroonga-9.0.2-x64-mingw32 test/test-column-cache.rb
rroonga-9.0.2-x86-mingw32 test/test-column-cache.rb
rroonga-9.0.2 test/test-column-cache.rb
rroonga-7.1.1-x64-mingw32 test/test-column-cache.rb
rroonga-7.1.1-x86-mingw32 test/test-column-cache.rb