message: Add some more self-reference tests
  Summary: A bunch of tests I've had sat around for a while. Some fail, so mark those as failing deliberately.
diff: @@ -710,6 +710,10 @@ assert_eq(x, 9)"#,
  );
  }
  +/// Some tests are currently disabled because self-referential things sometimes fail.
  +/// These should be fixed.
  +const SELF_REFERENCE_WORKS: bool = false;
  +
  #[test]
  fn test_self_mutate_list() {
  // Check functions that mutate and access self on lists
  @@ -748,7 +752,67 @@ xs.append(xs)
  xs.remove(xs)
  xs == [1, 2, 3]
  "#,
  - )
  + );
  + assert::is_true(
  + r#"
  +xs = [1, 2, 3]
  +xs += xs
  +xs == [1, 2, 3, 1, 2, 3]
  +"#,
  + );
  + assert::fail(
  + r#"
  +xs = []
  +xs[xs]
  +"#,
  + "Type of parameters mismatch",
  + );
  + if SELF_REFERENCE_WORKS {
  + assert::fail(
  + r#"
  +xs = []
  +xs[xs] = xs
  +"#,
  + "not an int",
  + );
  + }
  +}
  +
  +#[test]
  +fn test_self_mutate_dict() {
  + // Check functions that mutate and access self on dicts
  + assert::fail(
  + r#"
  +xs = {}
  +xs[xs]
  +"#,
  + "not hashable",
  + );
  + if SELF_REFERENCE_WORKS {
  + assert::fail(
  + r#"
  +xs = {}
  +xs[xs] = 1
  +"#,
  + "not hashable",
  + );
  + }
  + assert::is_true(
  + r#"
  +xs = {}
  +xs[1] = xs
  +len(xs[1]) == 1
  +"#,
  + );
  + if SELF_REFERENCE_WORKS {
  + assert::is_true(
  + r#"
  +xs = {}
  +xs.update(xs)
  +len(xs) == 0
  +"#,
  + );
  + }
  }
  #[test]
  