emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob b2c862bb737300909abf27f511e10540ab48d92d 1874 bytes (raw)
name: testing/examples/ob-rust-test.org 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 
#+Title: a collection of examples for ob-rust tests
#+OPTIONS: ^:nil

#+name: test-simple
#+BEGIN_SRC rust :results silent
  fn main() {
      let answer = 42;
      println!("{}", answer);
  }
#+END_SRC

#+name: test-main-wrapper
#+BEGIN_SRC rust :results silent
  let answer = 42;
  println!("{}", answer);
#+END_SRC

#+name: test-var-integer
#+BEGIN_SRC rust :var answer=42 :results silent
  println!("{}", answer);
#+END_SRC

#+name: test-var-float
#+BEGIN_SRC rust :var pi=3.14 :results silent
  println!("{}", pi);
#+END_SRC

#+name: test-var-char
#+BEGIN_SRC rust :var answer='x' :results silent
  println!("{}", answer);
#+END_SRC

#+name: test-var-string
#+BEGIN_SRC rust :var answer="GOAT" :results silent
  println!("{}", answer);
#+END_SRC

#+name: test-var-bool-true
#+BEGIN_SRC rust :var test='true :results silent
  if test {
    println!("42");
  }
#+END_SRC

#+name: test-var-bool-false
#+BEGIN_SRC rust :var test="false" :results silent
  if !test {
    println!("42");
  }
#+END_SRC

#+name: test-var-mutable
#+BEGIN_SRC rust :var mut_answer=41 :results silent
  answer = 42;
  println!("{}", answer);
#+END_SRC

#+name: test-var-given-type
#+BEGIN_SRC rust :var answer:i32=40 :results silent
  let additional_answer: i32 = 2;
  println!("{}", answer + additional_answer);
#+END_SRC

#+name: test-var-mutable-and-given-type
#+BEGIN_SRC rust :var mut_answer:i32=40 :results silent
  let additional_answer: i32 = 2;
  answer = answer + additional_answer;
  println!("{}", answer);
#+END_SRC

#+name: test-var-no-main-wrapper
#+BEGIN_SRC rust :var answer=42 :results silent
  fn main() {
      println!("{}", answer);
  }
#+END_SRC

#+name: test-uses-and-command-line-arguments
#+BEGIN_SRC rust :use std::env :cmdline 1 2 bonjour :results silent
  let args: Vec<String> = env::args().collect();
  println!("{}, {}, {}", args[1], args[2], args[3]);
#+END_SRC

debug log:

solving b2c862bb7 ...
found b2c862bb7 in https://list.orgmode.org/orgmode/e6762cad-e681-4ea3-b168-7c37cd69b170@getmailbird.com/

applying [1/1] https://list.orgmode.org/orgmode/e6762cad-e681-4ea3-b168-7c37cd69b170@getmailbird.com/
diff --git a/testing/examples/ob-rust-test.org b/testing/examples/ob-rust-test.org
new file mode 100644
index 000000000..b2c862bb7

Checking patch testing/examples/ob-rust-test.org...
Applied patch testing/examples/ob-rust-test.org cleanly.

index at:
100644 b2c862bb737300909abf27f511e10540ab48d92d	testing/examples/ob-rust-test.org

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).