コード例 #1
0
  void test_find() {
    tbl->put(state, 2, Fixnum::from(1));
    tbl->put(state, 3, Fixnum::from(2));

    TS_ASSERT_EQUALS(tbl->fetch(state, Fixnum::from(1)), Fixnum::from(2));
    TS_ASSERT_EQUALS(tbl->fetch(state, Fixnum::from(2)), cNil);
  }
コード例 #2
0
  void test_to_lookuptable() {
    LookupTable* lt;
    Object* key = Fixnum::from(1);
    Object* val = Fixnum::from(2);

    tbl->put(state, 2, key);
    tbl->put(state, 3, val);
    lt = tbl->to_lookuptable(state);

    TS_ASSERT_EQUALS(lt->fetch(state, key), val);
  }