Files
textmate/Frameworks/editor/tests/t_command.cc
Allan Odgaard 9894969e67 Initial commit
2012-08-09 16:25:56 +02:00

22 lines
579 B
C++

#include <editor/editor.h>
class CommandTests : public CxxTest::TestSuite
{
public:
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>());
// TS_ASSERT_EQUALS(editor.as_string(), "Hello\n");
}
};