Skip to content

Commit

Permalink
chore: first tests attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Sep 28, 2023
1 parent 334a94d commit 13705b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/errors/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@rules_cc//cc:defs.bzl", "cc_test")
load("@ecsact_interpret//bazel:copts.bzl", "copts")

_TESTS = [
"invalid_notify_settings",
"no_capabilities",
"no_package_statement_first",
"unknown_association_field",
Expand Down
10 changes: 10 additions & 0 deletions test/errors/invalid_notify_settings.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "gtest/gtest.h"
#include "ecsact/interpret/eval.h"

#include "test_lib.hh"

TEST(InvalidNotifySettings, InvalidNotifySettings) {
auto errs = ecsact_interpret_test_files({"errors/invalid_notify_settings.ecsact"});
ASSERT_EQ(errs.size(), 1);
ASSERT_EQ(errs[0].eval_error, ECSACT_EVAL_ERR_INVALID_NOTIFY_SETTING);
}
11 changes: 11 additions & 0 deletions test/errors/invalid_notify_settings.ecsact
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package error.invalid_notify_settings;

component ExampleComponent {
i32 num;
}

system InvalidNotifySetting {
readwrite ExampleComponent;

notify blah;
}

0 comments on commit 13705b3

Please sign in to comment.