Files
tubestation/third_party/rust/ron/tests/unicode.rs
Erich Gubler 6f3b669604 Bug 1956123 - build(webgpu): update WGPU to c7c79a0dc9356081a884b5518d1c08ce7a09c7c5 r=webgpu-reviewers,supply-chain-reviewers,nical
Notable WebGPU CTS changes:

- Demotions from tier 2 to tier 3:
	- `webgpu:shader,execution,expression,unary,{i32,u32}_conversion:f32:*` started regressing on Windows.
- Promotions to tier 2 from tier 3:
	- Across all platforms:
		- `webgpu:shader,execution,expression,call,builtin,cross:f32:*`
		- `webgpu:shader,execution,expression,unary,i32_conversion:abstract_float:*`
		- `webgpu:shader,execution,expression,unary,u32_conversion:abstract_float:*`
		- `webgpu:shader,execution,limits:nesting_depth_braces:*`
		- `webgpu:shader,validation,expression,call,builtin,value_constructor:vector_copy:*`
		- `webgpu:shader,validation,expression,call,builtin,value_constructor:vector_elementwise:*`
		- `webgpu:shader,validation,expression,call,builtin,value_constructor:vector_mixed:*`
	- `webgpu:shader,validation,expression,call,builtin,value_constructor:scalar_zero_value:*` was promoted on Linux and Windows, but stays in macOS on account of failing `f16` functionality. My guess is that these failures are also present on the other platforms, but we don't see the because `shader-f16` is not aviailable on our other CI platforms yet.
	- From macOS, completing the set of all platforms passing:
		- `f16` functionality, which, again, was likely not visible on our other CI platforms before:
			- `webgpu:shader,execution,expression,call,builtin,cross:f16:*`
			- `webgpu:shader,validation,decl,override:type:*`
	- `webgpu:api,validation,capability_checks,limits,maxUniformBufferBindingSize:createBindGroup,at_over:*`
	  was promoted on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D243593
2025-04-02 00:36:43 +00:00

63 lines
1.7 KiB
Rust

use ron::{
de::{from_bytes, from_str},
error::Position,
Error, Value,
};
#[test]
fn test_char() {
let de: char = from_str("'Փ'").unwrap();
assert_eq!(de, 'Փ');
}
#[test]
fn test_string() {
let de: String = from_str("\"My string: ऄ\"").unwrap();
assert_eq!(de, "My string: ऄ");
}
#[test]
fn test_char_not_a_comment() {
let _ = from_str::<ron::Value>("A('/')").unwrap();
}
#[test]
fn ident_starts_with_non_ascii_byte() {
let _ = from_str::<Value>("שּׁȬSSSSSSSSSSR").unwrap();
}
#[test]
fn test_file_invalid_unicode() {
let error = from_bytes::<Value>(&[b'\n', b'a', 0b11000000, 0]).unwrap_err();
assert!(matches!(error.code, Error::Utf8Error(_)));
assert_eq!(error.position, Position { line: 2, col: 2 });
let error = from_bytes::<Value>(&[b'\n', b'\n', 0b11000000]).unwrap_err();
assert!(matches!(error.code, Error::Utf8Error(_)));
assert_eq!(error.position, Position { line: 3, col: 1 });
}
#[test]
fn serialize_invalid_whitespace() {
assert_eq!(
ron::ser::to_string_pretty(&42, ron::ser::PrettyConfig::default().new_line("a"))
.unwrap_err(),
Error::Message(String::from(
"Invalid non-whitespace `PrettyConfig::new_line`"
))
);
assert_eq!(
ron::ser::to_string_pretty(&42, ron::ser::PrettyConfig::default().indentor("a"))
.unwrap_err(),
Error::Message(String::from(
"Invalid non-whitespace `PrettyConfig::indentor`"
))
);
assert_eq!(
ron::ser::to_string_pretty(&42, ron::ser::PrettyConfig::default().separator("a"))
.unwrap_err(),
Error::Message(String::from(
"Invalid non-whitespace `PrettyConfig::separator`"
))
);
}