Skip to content

Commit

Permalink
Merge pull request #196 from stepchowfun/readme-wordsmithing
Browse files Browse the repository at this point in the history
Wordsmith the README
  • Loading branch information
stepchowfun authored Oct 8, 2021
2 parents 957354c + b95c742 commit 536f170
Show file tree
Hide file tree
Showing 13 changed files with 640 additions and 595 deletions.
141 changes: 93 additions & 48 deletions README.md

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions integration_tests/rust/src/comprehensive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ pub fn run() -> io::Result<()> {
y_required: u64::MAX,
z_required: (),

p_unstable: vec![(), (), ()],
q_unstable: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_unstable: vec![i64::MIN, 0, i64::MAX],
s_unstable: vec![
p_asymmetric: vec![(), (), ()],
q_asymmetric: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_asymmetric: vec![i64::MIN, 0, i64::MAX],
s_asymmetric: vec![
vec!["Hello".to_owned(), "World".to_owned()],
vec!["Hello".to_owned(), "Earth".to_owned()],
vec!["Hello".to_owned(), "Planet".to_owned()],
],
t_unstable: true,
u_unstable: vec![0, 42, 255],
v_unstable: PI,
w_unstable: i64::MAX,
x_unstable: "Hello, World!".to_owned(),
y_unstable: u64::MAX,
z_unstable: (),
t_asymmetric: true,
u_asymmetric: vec![0, 42, 255],
v_asymmetric: PI,
w_asymmetric: i64::MAX,
x_asymmetric: "Hello, World!".to_owned(),
y_asymmetric: u64::MAX,
z_asymmetric: (),

p_optional: None,
q_optional: None,
Expand Down Expand Up @@ -82,21 +82,21 @@ pub fn run() -> io::Result<()> {
y_required: u64::MAX,
z_required: (),

p_unstable: vec![(), (), ()],
q_unstable: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_unstable: vec![i64::MIN, 0, i64::MAX],
s_unstable: vec![
p_asymmetric: vec![(), (), ()],
q_asymmetric: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_asymmetric: vec![i64::MIN, 0, i64::MAX],
s_asymmetric: vec![
vec!["Hello".to_owned(), "World".to_owned()],
vec!["Hello".to_owned(), "Earth".to_owned()],
vec!["Hello".to_owned(), "Planet".to_owned()],
],
t_unstable: true,
u_unstable: vec![0, 42, 255],
v_unstable: PI,
w_unstable: i64::MAX,
x_unstable: "Hello, World!".to_owned(),
y_unstable: u64::MAX,
z_unstable: (),
t_asymmetric: true,
u_asymmetric: vec![0, 42, 255],
v_asymmetric: PI,
w_asymmetric: i64::MAX,
x_asymmetric: "Hello, World!".to_owned(),
y_asymmetric: u64::MAX,
z_asymmetric: (),

p_optional: Some(vec![(), (), ()]),
q_optional: Some(vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN]),
Expand Down Expand Up @@ -201,39 +201,39 @@ pub fn run() -> io::Result<()> {

let fallback = BarOut::TRequired(true);

check_match::<BarOut, BarIn>(BarOut::PUnstable(
check_match::<BarOut, BarIn>(BarOut::PAsymmetric(
vec![(), (), ()],
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::QUnstable(
check_match::<BarOut, BarIn>(BarOut::QAsymmetric(
vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::RUnstable(
check_match::<BarOut, BarIn>(BarOut::RAsymmetric(
vec![i64::MIN, 0, i64::MAX],
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::SUnstable(
check_match::<BarOut, BarIn>(BarOut::SAsymmetric(
vec![
vec!["Hello".to_owned(), "World".to_owned()],
vec!["Hello".to_owned(), "Earth".to_owned()],
vec!["Hello".to_owned(), "Planet".to_owned()],
],
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::TUnstable(true, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::UUnstable(
check_match::<BarOut, BarIn>(BarOut::TAsymmetric(true, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::UAsymmetric(
vec![0, 42, 255],
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::VUnstable(PI, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::WUnstable(i64::MAX, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::XUnstable(
check_match::<BarOut, BarIn>(BarOut::VAsymmetric(PI, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::WAsymmetric(i64::MAX, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::XAsymmetric(
"Hello, World!".to_owned(),
Box::new(fallback.clone()),
))?;
check_match::<BarOut, BarIn>(BarOut::YUnstable(u64::MAX, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::ZUnstable(Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::YAsymmetric(u64::MAX, Box::new(fallback.clone())))?;
check_match::<BarOut, BarIn>(BarOut::ZAsymmetric(Box::new(fallback.clone())))?;

check_match::<BarOut, BarIn>(BarOut::POptional(
vec![(), (), ()],
Expand Down Expand Up @@ -289,21 +289,21 @@ pub fn run() -> io::Result<()> {
y_required: u64::MAX,
z_required: (),

p_unstable: vec![(), (), ()],
q_unstable: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_unstable: vec![i64::MIN, 0, i64::MAX],
s_unstable: vec![
p_asymmetric: vec![(), (), ()],
q_asymmetric: vec![f64::NEG_INFINITY, f64::INFINITY, f64::NAN],
r_asymmetric: vec![i64::MIN, 0, i64::MAX],
s_asymmetric: vec![
vec!["Hello".to_owned(), "World".to_owned()],
vec!["Hello".to_owned(), "Earth".to_owned()],
vec!["Hello".to_owned(), "Planet".to_owned()],
],
t_unstable: true,
u_unstable: vec![0, 42, 255],
v_unstable: PI,
w_unstable: i64::MAX,
x_unstable: "Hello, World!".to_owned(),
y_unstable: u64::MAX,
z_unstable: (),
t_asymmetric: true,
u_asymmetric: vec![0, 42, 255],
v_asymmetric: PI,
w_asymmetric: i64::MAX,
x_asymmetric: "Hello, World!".to_owned(),
y_asymmetric: u64::MAX,
z_asymmetric: (),

p_optional: None,
q_optional: None,
Expand Down
40 changes: 20 additions & 20 deletions integration_tests/rust/src/schema_evolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ use {
pub fn run() -> io::Result<()> {
check_ok::<before::ExampleStructOut, after::ExampleStructIn>(&before::ExampleStructOut {
required_to_required: "required_to_required".to_owned(),
required_to_unstable: "required_to_unstable".to_owned(),
required_to_asymmetric: "required_to_asymmetric".to_owned(),
required_to_optional: "required_to_optional".to_owned(),
required_to_nonexistent: "required_to_nonexistent".to_owned(),
unstable_to_required: "unstable_to_required".to_owned(),
unstable_to_unstable: "unstable_to_unstable".to_owned(),
unstable_to_optional: "unstable_to_optional".to_owned(),
unstable_to_nonexistent: "unstable_to_nonexistent".to_owned(),
optional_none_to_unstable: None,
asymmetric_to_required: "asymmetric_to_required".to_owned(),
asymmetric_to_asymmetric: "asymmetric_to_asymmetric".to_owned(),
asymmetric_to_optional: "asymmetric_to_optional".to_owned(),
asymmetric_to_nonexistent: "asymmetric_to_nonexistent".to_owned(),
optional_none_to_asymmetric: None,
optional_none_to_optional: None,
optional_none_to_nonexistent: None,
optional_some_to_required: Some("optional_some_to_required".to_owned()),
optional_some_to_unstable: Some("optional_some_to_unstable".to_owned()),
optional_some_to_asymmetric: Some("optional_some_to_asymmetric".to_owned()),
optional_some_to_optional: Some("optional_some_to_optional".to_owned()),
optional_some_to_nonexistent: Some("optional_some_to_nonexistent".to_owned()),
})?;
Expand All @@ -32,40 +32,40 @@ pub fn run() -> io::Result<()> {
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::RequiredToUnstable("RequiredToUnstable".to_owned()),
&before::ExampleChoiceOut::RequiredToAsymmetric("RequiredToAsymmetric".to_owned()),
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::UnstableToRequired(
"UnstableToRequired".to_owned(),
&before::ExampleChoiceOut::AsymmetricToRequired(
"AsymmetricToRequired".to_owned(),
Box::new(fallback.clone()),
),
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::UnstableToUnstable(
"UnstableToUnstable".to_owned(),
&before::ExampleChoiceOut::AsymmetricToAsymmetric(
"AsymmetricToAsymmetric".to_owned(),
Box::new(fallback.clone()),
),
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::UnstableToOptionalHandled(
"UnstableToOptionalHandled".to_owned(),
&before::ExampleChoiceOut::AsymmetricToOptionalHandled(
"AsymmetricToOptionalHandled".to_owned(),
Box::new(fallback.clone()),
),
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::UnstableToOptionalFallback(
"UnstableToOptionalFallback".to_owned(),
&before::ExampleChoiceOut::AsymmetricToOptionalFallback(
"AsymmetricToOptionalFallback".to_owned(),
Box::new(fallback.clone()),
),
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::UnstableToNonexistent(
"UnstableToNonexistent".to_owned(),
&before::ExampleChoiceOut::AsymmetricToNonexistent(
"AsymmetricToNonexistent".to_owned(),
Box::new(fallback.clone()),
),
)?;
Expand All @@ -78,8 +78,8 @@ pub fn run() -> io::Result<()> {
)?;

check_ok::<before::ExampleChoiceOut, after::ExampleChoiceIn>(
&before::ExampleChoiceOut::OptionalToUnstable(
"OptionalToUnstable".to_owned(),
&before::ExampleChoiceOut::OptionalToAsymmetric(
"OptionalToAsymmetric".to_owned(),
Box::new(fallback.clone()),
),
)?;
Expand Down
22 changes: 11 additions & 11 deletions integration_tests/types/comprehensive/bar.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ choice bar {
y_required: u64 = 9
z_required = 10

unstable p_unstable: [unit] = 11
unstable q_unstable: [f64] = 12
unstable r_unstable: [s64] = 13
unstable s_unstable: [[string]] = 14
unstable t_unstable: bool = 15
unstable u_unstable: bytes = 16
unstable v_unstable: f64 = 17
unstable w_unstable: s64 = 18
unstable x_unstable: string = 19
unstable y_unstable: u64 = 20
unstable z_unstable = 21
asymmetric p_asymmetric: [unit] = 11
asymmetric q_asymmetric: [f64] = 12
asymmetric r_asymmetric: [s64] = 13
asymmetric s_asymmetric: [[string]] = 14
asymmetric t_asymmetric: bool = 15
asymmetric u_asymmetric: bytes = 16
asymmetric v_asymmetric: f64 = 17
asymmetric w_asymmetric: s64 = 18
asymmetric x_asymmetric: string = 19
asymmetric y_asymmetric: u64 = 20
asymmetric z_asymmetric = 21

optional p_optional: [unit] = 22
optional q_optional: [f64] = 23
Expand Down
22 changes: 11 additions & 11 deletions integration_tests/types/comprehensive/foo.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ struct foo {
y_required: u64 = 9
z_required = 10

unstable p_unstable: [unit] = 11
unstable q_unstable: [f64] = 12
unstable r_unstable: [s64] = 13
unstable s_unstable: [[string]] = 14
unstable t_unstable: bool = 15
unstable u_unstable: bytes = 16
unstable v_unstable: f64 = 17
unstable w_unstable: s64 = 18
unstable x_unstable: string = 19
unstable y_unstable: u64 = 20
unstable z_unstable = 21
asymmetric p_asymmetric: [unit] = 11
asymmetric q_asymmetric: [f64] = 12
asymmetric r_asymmetric: [s64] = 13
asymmetric s_asymmetric: [[string]] = 14
asymmetric t_asymmetric: bool = 15
asymmetric u_asymmetric: bytes = 16
asymmetric v_asymmetric: f64 = 17
asymmetric w_asymmetric: s64 = 18
asymmetric x_asymmetric: string = 19
asymmetric y_asymmetric: u64 = 20
asymmetric z_asymmetric = 21

optional p_optional: [unit] = 22
optional q_optional: [f64] = 23
Expand Down
32 changes: 16 additions & 16 deletions integration_tests/types/schema_evolution/after.t
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
struct example_struct {
required_to_required: string = 0
unstable required_to_unstable: string = 1
asymmetric required_to_asymmetric: string = 1
optional required_to_optional: string = 2
# required_to_nonexistent: string = 3

unstable_to_required: string = 4
unstable unstable_to_unstable: string = 5
optional unstable_to_optional: string = 6
# unstable_to_nonexistent: string = 7
asymmetric_to_required: string = 4
asymmetric asymmetric_to_asymmetric: string = 5
optional asymmetric_to_optional: string = 6
# asymmetric_to_nonexistent: string = 7

# optional_none_to_required: string = 8 # This case would be an error.
unstable optional_none_to_unstable: string = 9
asymmetric optional_none_to_asymmetric: string = 9
optional optional_none_to_optional: string = 10
# optional_none_to_nonexistent: string = 11

optional_some_to_required: string = 12
unstable optional_some_to_unstable: string = 13
asymmetric optional_some_to_asymmetric: string = 13
optional optional_some_to_optional: string = 14
# optional_some_to_nonexistent: string = 15

# nonexistent_to_required: string = 16 # This case would be an error.
unstable nonexistent_to_unstable: string = 17
asymmetric nonexistent_to_asymmetric: string = 17
optional nonexistent_to_optional: string = 18
# nonexistent_to_nonexistent: string = 19
}

choice example_choice {
required_to_required: string = 0
unstable required_to_unstable: string = 1
asymmetric required_to_asymmetric: string = 1
# optional required_to_optional_handled: string = 2 # This case would be an error.
# optional required_to_optional_fallback: string = 3 # This case would be an error.
# required_to_nonexistent: string = 4 # This case would be an error.

unstable_to_required: string = 5
unstable unstable_to_unstable: string = 6
optional unstable_to_optional_handled: string = 7
optional unstable_to_optional_fallback: string = 8
# unstable_to_nonexistent: string = 9
asymmetric_to_required: string = 5
asymmetric asymmetric_to_asymmetric: string = 6
optional asymmetric_to_optional_handled: string = 7
optional asymmetric_to_optional_fallback: string = 8
# asymmetric_to_nonexistent: string = 9

optional_to_required: string = 10
unstable optional_to_unstable: string = 11
asymmetric optional_to_asymmetric: string = 11
optional optional_to_optional_handled: string = 12
optional optional_to_optional_fallback: string = 13
# optional_to_nonexistent: string = 14

nonexistent_to_required: string = 15
unstable nonexistent_to_unstable: string = 16
asymmetric nonexistent_to_asymmetric: string = 16
optional nonexistent_to_optional_handled: string = 17
optional nonexistent_to_optional_fallback: string = 18
# nonexistent_to_nonexistent: string = 19
Expand Down
Loading

0 comments on commit 536f170

Please sign in to comment.