int is_locked(){ int _STATE_ = -1; ifstream if_s(LOCK); if(if_s.good()) _STATE_ = 0; if_s.close(); return _STATE_; };
TEST(YcmFileTests, WriteHeaderTest) { cproject::YcmFile ycm(".ycm_extra_conf_test.py"); std::ifstream if_s(".ycm_extra_conf_test.py"); ycm.WriteHeader(); ycm.CloseWriter(); std::string vals[2]; std::getline(if_s, vals[0]); std::getline(if_s, vals[1]); EXPECT_EQ(vals[0], "import os"); EXPECT_EQ(vals[1], "import ycm_core"); }