Test rule by inserting and comparing it.