Files
textmate/Frameworks/editor/tests/t_command.cc
2014-04-14 14:26:52 +07:00

18 lines
501 B
C++

#include <editor/editor.h>
void test_replace_selection_command ()
{
static std::string const plistSrc =
"{ command = '#!/bin/sh\necho Hello';"
" input = 'document';"
" output = 'insertAsSnippet';"
"}";
ng::buffer_t buf;
ng::editor_t editor(buf);
editor.insert("to be replaced");
editor.perform(ng::kSelectAll);
editor.execute_dispatch(boost::get<plist::dictionary_t>(plist::parse(plistSrc)), std::map<std::string, std::string>());
// OAK_ASSERT_EQ(editor.as_string(), "Hello\n");
}