Custom terms inserting as single string with commas, not separated

you need to make an array from comma separated string of keywords like

$keywords = explode(',', $keywords);

then your insert post data array will be.

$new_post = array(
  'post_title'    => $title,
  'tax_input'    => array( 'keyword' => $keywords ),
  'post_status'   => 'publish',
  'post_type' => 'test'
);