From 8947fa348a705569e20ed873b157ca7e8a7aec38 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Fri, 14 Apr 2017 15:27:57 -0400 Subject: [PATCH] update tests Some PRs were landed in the meantime --- tests/book/book.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/book/book.js b/tests/book/book.js index c3cbcfcc..52be9a9d 100644 --- a/tests/book/book.js +++ b/tests/book/book.js @@ -208,6 +208,18 @@ function run_rust_code(code_block) { result_block = code_block.find(".result"); } + let text = code_block.find(".language-rust").text(); + + let params = { + version: "stable", + optimize: "0", + code: text, + }; + + if(text.includes("#![feature")) { + params.version = "nightly"; + } + result_block.text("Running..."); $.ajax({ @@ -216,7 +228,7 @@ function run_rust_code(code_block) { crossDomain: true, dataType: "json", contentType: "application/json", - data: JSON.stringify({version: "stable", optimize: "0", code: code_block.find(".language-rust").text() }), + data: JSON.stringify(params), success: function(response){ result_block.text(response.result); }