Skip to content

Commit

Permalink
unicode strins test temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dragazo committed Aug 14, 2024
1 parent 228bfe3 commit 1f0fed4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/test/blocks/unicode-strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<blocks app="NetsBlox 2.4.6, http://netsblox.org" version="2.4.6"><block-definition collabId="item_43" s="main" type="reporter" category="custom"><header></header><code></code><translations></translations><inputs></inputs><script><block collabId="item_44" s="doDeclareVariables"><list><l>a</l></list></block><block collabId="item_45" s="doSetVar"><l>a</l><block collabId="item_47" s="reportNewList"><list></list></block></block><block collabId="item_185" s="doAddToList"><custom-block collabId="item_185_1" s="split info %s"><l>x</l></custom-block><block collabId="item_185_2" var="a"/></block><block collabId="item_120" s="doAddToList"><custom-block collabId="item_172" s="split info %s"><l>hello world!</l></custom-block><block collabId="item_120_2" var="a"/></block><block collabId="item_182" s="doAddToList"><custom-block collabId="item_182_1" s="split info %s"><l>abc😊🥲😎👀a̐éö̲물彩虹xyz</l></custom-block><block collabId="item_182_2" var="a"/></block><block collabId="item_184" s="doAddToList"><custom-block collabId="item_184_1" s="split info %s"><l>The quick ("brown") fox can&apos;t jump 32.3 feet, right?</l></custom-block><block collabId="item_184_2" var="a"/></block><block collabId="item_51" s="doReport"><block collabId="item_52" var="a"/></block></script></block-definition><block-definition collabId="item_143" s="split info %&apos;b&apos;" type="reporter" category="custom"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block collabId="item_145" s="doDeclareVariables"><list><l>a</l></list></block><block collabId="item_146" s="doSetVar"><l>a</l><block collabId="item_155" s="reportNewList"><list></list></block></block><block collabId="item_53" s="doAddToList"><block collabId="item_82" var="b"/><block collabId="item_55" var="a"/></block><block collabId="item_56" s="doAddToList"><block collabId="item_49" s="reportTextSplit"><block collabId="item_84" var="b"/><l><option>letter</option></l></block><block collabId="item_56_2" var="a"/></block><block collabId="item_109" s="doAddToList"><block collabId="item_111" s="reportTextSplit"><block collabId="item_112" var="b"/><l><option>word</option></l></block><block collabId="item_109_2" var="a"/></block><block collabId="item_88" s="doAddToList"><block collabId="item_85" s="reportStringSize"><block collabId="item_86" var="b"/></block><block collabId="item_88_2" var="a"/></block><block collabId="item_96" s="doFor"><l>i</l><l>1</l><block collabId="item_97" s="reportStringSize"><block collabId="item_97_1" var="b"/></block><script><block collabId="item_98" s="doAddToList"><block collabId="item_100" s="reportLetter"><block collabId="item_101" var="i"/><block collabId="item_102" var="b"/></block><block collabId="item_98_2" var="a"/></block></script></block><block collabId="item_157" s="doAddToList"><block collabId="item_157_2" s="reportUnicode"><block collabId="item_157_4" var="b"/></block><block collabId="item_157_3" var="a"/></block><block collabId="item_157_1" s="doAddToList"><block collabId="item_157_5" s="reportUnicodeAsLetter"><block collabId="item_157_7" s="reportUnicode"><block collabId="item_157_8" var="b"/></block></block><block collabId="item_157_6" var="a"/></block><block collabId="item_148" s="doReport"><block collabId="item_149" var="a"/></block></script></block-definition></blocks>
18 changes: 18 additions & 0 deletions src/test/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2454,6 +2454,24 @@ fn test_proc_stop_fn() {
});
}

#[test]
fn test_proc_unicode_strings() {
let system = Rc::new(StdSystem::new_sync(CompactString::new(BASE_URL), None, Config::default(), Arc::new(Clock::new(UtcOffset::UTC, None))));
let (mut env, _) = get_running_proc(Default::default(), &format!(include_str!("templates/generic-static.xml"),
globals = "",
fields = "",
funcs = include_str!("blocks/unicode-strings.xml"),
methods = "",
), Settings { rpc_error_scheme: ErrorScheme::Soft, ..Default::default() }, system, |_| SymbolTable::default());

run_till_term(&mut env, |mc, _, res| {
let expect = Value::from_simple(mc, SimpleValue::from_json(json!([

])).unwrap());
assert_values_eq(&res.unwrap().0, &expect, 1e-5, "unicode strings");
});
}

#[test]
fn test_proc_ext_raii() {
let config = Config::<C, StdSystem<C>> {
Expand Down

0 comments on commit 1f0fed4

Please sign in to comment.