message: Break up kindcheck tests some more
diff: @@ -479,8 +479,6 @@ pub mod tests {
  use source::BytePos as B;
  use super::*;
  - // Add expressions
  -
  mod type_of {
  use super::*;
  @@ -572,6 +570,9 @@ pub mod tests {
  mod kind_of {
  use super::*;
  + mod const_ty {
  + use super::*;
  +
  #[test]
  fn ty_const() {
  let env = Env::default();
  @@ -579,9 +580,13 @@ pub mod tests {
  assert_eq!(kind_of(&env, &ty), Ok(Kind::Binary));
  }
  + }
  +
  + mod var_ty {
  + use super::*;
  #[test]
  - fn var() {
  + fn defined() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "u8").unwrap();
  @@ -589,7 +594,7 @@ pub mod tests {
  }
  #[test]
  - fn var_missing() {
  + fn undefined() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "Foo").unwrap();
  @@ -601,9 +606,13 @@ pub mod tests {
  ))
  );
  }
  + }
  +
  + mod union_ty {
  + use super::*;
  #[test]
  - fn union() {
  + fn simple() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "union { u8, u16, i32 }").unwrap();
  @@ -611,7 +620,7 @@ pub mod tests {
  }
  #[test]
  - fn union_element_missing() {
  + fn undefined_element() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "union { u8, Foo, i32 }").unwrap();
  @@ -623,9 +632,13 @@ pub mod tests {
  ))
  );
  }
  + }
  +
  + mod struct_ty {
  + use super::*;
  #[test]
  - fn pair() {
  + fn simple() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "struct { x: u8, y: u8 }").unwrap();
  @@ -633,15 +646,19 @@ pub mod tests {
  }
  #[test]
  - fn dependent_pair() {
  + fn dependent() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "struct { len: u8, data: [u8; len] }").unwrap();
  assert_eq!(kind_of(&env, &ty), Ok(Kind::Binary));
  }
  + }
  +
  + mod array_ty {
  + use super::*;
  #[test]
  - fn array() {
  + fn constant_size() {
  let env = Env::default();
  let ty = parser::parse_ty(&env, "[u8; 16]").unwrap();
  @@ -649,7 +666,7 @@ pub mod tests {
  }
  #[test]
  - fn array_len() {
  + fn constant_variable_size() {
  let mut env = Env::default();
  let len_ty = Type::UInt(32, Endianness::Target);
  env.add_binding("len", len_ty);
  @@ -659,7 +676,7 @@ pub mod tests {
  }
  #[test]
  - fn array_singned_int_size() {
  + fn signed_int_size() {
  let mut env = Env::default();
  let len_ty = parser::parse_ty(&env, "i8").unwrap();
  env.add_binding("len", len_ty.clone());
  @@ -675,7 +692,7 @@ pub mod tests {
  }
  #[test]
  - fn array_struct_size() {
  + fn struct_size() {
  let mut env = Env::default();
  let len_ty = parser::parse_ty(&env, "struct {}").unwrap();
  env.add_binding("len", len_ty.clone());
  @@ -691,3 +708,4 @@ pub mod tests {
  }
  }
  }
  +}
  