if you create a 3rd table like:
create table test3(id integer primary key, test_id integer, foreign
key(test_id) references test(id));
the problem stops. you can see the difference by querying:
pragma foreign_key_list(test2);
pragma foreign_key_list(test3);
maybe sqlite shouldn't accept the "references test" without the
"(id)"?