Files
sakurac/tests/analyzer/names.sakura
T
2026-10-28 22:13:49 -05:00

20 lines
674 B
Plaintext

#! @file names.sakura
#! @author John Christman (sorakatadzuma@gmail.com)
#! @copyright Malunal Studios, LLC.
#! @license MIT
#!
#! Contains the test that the reserved words follow the keywords, where the
#! names table interns them.
import std::testing;
module sakura::analyzer;
@test def reserved_words_follow_the_keywords(t: &mut tester): void {
var table := names::new();
t.expects(table.is_keyword(table.intern("while")) && !table.is_keyword(table.intern("this")));
t.expects(table.is_reserved(table.intern("this")) && table.is_reserved(table.intern("_")));
t.expects(!table.is_reserved(table.intern("get")) && !table.is_reserved(table.intern("thing")));
}