A new test could reveal whether the victim of a suicide attempt would try to kill himself again.