about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarcus Klaas <mail@marcusklaas.nl>2015-08-01 14:22:31 +0200
committerMarcus Klaas <mail@marcusklaas.nl>2015-08-02 12:40:02 +0200
commit0f640b06ddac1ff6033fba2836f3ad0e71390db7 (patch)
tree75b2514e44d064ab2c16193b5999eb55d66eedee /tests
parent7214008f6080a909f8d7af7713fbd207fab93ca5 (diff)
Properly format unsafe blocks
Diffstat (limited to 'tests')
-rw-r--r--tests/source/expr.rs18
-rw-r--r--tests/target/expr.rs19
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/source/expr.rs b/tests/source/expr.rs
index bfa1edc5311..e7862b83e50 100644
--- a/tests/source/expr.rs
+++ b/tests/source/expr.rs
@@ -73,3 +73,21 @@ fn bar() {
              aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
              a);
 }
+
+fn baz() {
+    unsafe    /*    {}{}{}{{{{}}   */   {
+        let foo = 1u32;
+    }
+
+    unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong comment */ {}
+
+    unsafe // So this is a very long comment.
+           // Multi-line, too.
+           // Will it still format correctly?
+    {
+    }
+
+    unsafe {
+        // Regular unsafe block
+    }
+}
diff --git a/tests/target/expr.rs b/tests/target/expr.rs
index b76bd408ac9..a1875a0ec26 100644
--- a/tests/target/expr.rs
+++ b/tests/target/expr.rs
@@ -102,3 +102,22 @@ fn bar() {
     let x = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
              a);
 }
+
+fn baz() {
+    unsafe /* {}{}{}{{{{}} */ {
+        let foo = 1u32;
+    }
+
+    unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
+            * comment */ {
+    }
+
+    unsafe /* So this is a very long comment.
+            * Multi-line, too.
+            * Will it still format correctly? */ {
+    }
+
+    unsafe {
+        // Regular unsafe block
+    }
+}