aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/v/fmt/tests/comments_expected.vv
diff options
context:
space:
mode:
Diffstat (limited to 'v_windows/v/vlib/v/fmt/tests/comments_expected.vv')
-rw-r--r--v_windows/v/vlib/v/fmt/tests/comments_expected.vv105
1 files changed, 105 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/fmt/tests/comments_expected.vv b/v_windows/v/vlib/v/fmt/tests/comments_expected.vv
new file mode 100644
index 0000000..859908f
--- /dev/null
+++ b/v_windows/v/vlib/v/fmt/tests/comments_expected.vv
@@ -0,0 +1,105 @@
+import time // foo
+
+/*
+block
+comment
+*/
+
+fn fun() int {
+ // comment zero
+ return 0 // another comment
+}
+
+fn mr_fun() (int, int) {
+ // one comment
+ // another comment
+ return 1, 2
+}
+
+fn single_line_blocks() {
+ // 1
+ println('')
+ // 2
+ println('')
+ // 3
+ // 4
+ println('')
+ // 5
+ // 6
+}
+
+fn main() {
+ /*
+ block1
+ */
+ /*
+ block2
+ */
+ /*
+ block3
+ */
+ // this is a comment
+ a := 1
+ // and another comment
+ // just to make it worse
+ b, c := a, 2
+ d := c // and an extra one
+ e := c
+ // more comments = more good
+ arr := [
+ // block foo bar
+ // inline foo bar
+ 0,
+ ]
+ // before arg comment
+ // after arg comment
+ println('this is a test')
+ // before if expr
+ // after if expr
+ if true {
+ println('if')
+ }
+ // before else if
+ // between else if
+ else if false {
+ println('else if')
+ }
+ // before else
+ // after else
+ else {
+ println('else')
+ }
+ // empty return
+ return
+}
+
+fn insert_space() {
+ // abc
+}
+
+fn linebreaks_in_block_comments() {
+ /*
+ foo
+ comment goes here!
+ bar
+ */
+ /*
+ spam
+ spaces make no difference there
+ eggs
+ */
+}
+
+fn between_if_branches() {
+ if spam {
+ }
+ // remove the empty line above
+ else if eggs {
+ }
+
+ if spam2 {
+ }
+ // remove the empty line below
+ else {
+ }
+}