mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Multiline contract comments #2113
This commit is contained in:
40
test/test_suite/errors/contract_multi.c3
Normal file
40
test/test_suite/errors/contract_multi.c3
Normal file
@@ -0,0 +1,40 @@
|
||||
module contract_err_tests;
|
||||
|
||||
<*
|
||||
Hello world
|
||||
@param [in] a
|
||||
: "param description"
|
||||
@require 1 == 2 : "Some text, "
|
||||
"that" " continues "
|
||||
`-here `
|
||||
@require 1 = 1
|
||||
@return "hello"
|
||||
"world"
|
||||
@return? io::EOF :
|
||||
"errors"
|
||||
*>
|
||||
macro usz @a(a) => a;
|
||||
|
||||
<*
|
||||
Hello world
|
||||
@param [in] a :
|
||||
"param description"
|
||||
@require 1 == 2
|
||||
:
|
||||
"Some text, "
|
||||
"that" " continues "
|
||||
`-here `
|
||||
@require 1 = 1
|
||||
@return
|
||||
"hello"
|
||||
"world"
|
||||
@return? io::EOF
|
||||
: "errors"
|
||||
*>
|
||||
macro usz @b(a) => a;
|
||||
|
||||
fn int main()
|
||||
{
|
||||
usz t = @a(1); // #error: 'Some text, that continues -here '
|
||||
return 0;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ struct TextTag
|
||||
}
|
||||
|
||||
<*
|
||||
@require self.tags.len == 0 "template already initialized"
|
||||
@require self.tags.len == 0 : "template already initialized"
|
||||
@require tag_start != tag_end
|
||||
*>
|
||||
fn void? TextTemplate.init(&self, String template, String tag_start = "{{", String tag_end = "}}", Allocator using = allocator::heap())
|
||||
|
||||
Reference in New Issue
Block a user