[test] Adding tests for the optimizer