Ejemplo n.º 1
0
  void test_allocate() {
    Class* sub = ontology::new_class(state, "RegexpSub", G(regexp), 0);
    Regexp* re = Regexp::allocate(state, sub);

    TS_ASSERT_EQUALS(re->klass(), sub);
  }
Ejemplo n.º 2
0
 // 'self' is passed in automatically by the primitive glue
 Regexp* Regexp::allocate(STATE, Object* self) {
   Regexp* re = Regexp::create(state);
   re->onig_data = 0;
   re->klass(state, (Class*)self);
   return re;
 }
Ejemplo n.º 3
0
 void test_create() {
   Regexp* re = Regexp::create(state);
   TS_ASSERT(re->source()->nil_p());
   TS_ASSERT(re->names()->nil_p());
   TS_ASSERT_EQUALS(re->klass(), G(regexp));
 }
Ejemplo n.º 4
0
 // 'self' is passed in automatically by the primitive glue
 Regexp* Regexp::allocate(STATE, Object* self) {
   Regexp* re = Regexp::create(state);
   re->onig_data = NULL;
   re->klass(state, as<Class>(self));
   return re;
 }