Skip to content

test failure: tests::test_programs::path_14_test_programs_objects_blis ... FAILED #1

Description

@ttiimm

Saw the following issue on checkout and running cargo test.

---- tests::test_programs::path_14_test_programs_objects_blis stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot file: src/snapshots/blis__tests__test_programs__objects.blis.stdout.snap
Snapshot: test_programs/objects.blis.stdout
Source: src/lib.rs:62
Input file: test_programs/objects.blis
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
func main() {
    let one = Counter.new("uno");
    let two = Counter.new("dos");

    println(one);
    println(one.id, one.name);

    println(two);
    println(two.id, two.name);

    // Eventually, gradual typing will let you prevent this. But for now...
    one.two = two;
    two.one = one;

    println(one.two);
    println(one["two"]);
    println(two.one);
    println(two["one"]);

    println(Counter.new);
    println(one.incr);
    println(one.add);
    println(two.incr);
    println(two.add);
}

let id = 0;

type Counter with {
    func new(name) {
        id = id + 1;

        Counter {
            id = id,
            name = name,
            count = 0,
        }
    }

    func self.incr() {
        self.add(1);
    }

    func self.add(delta) {
        self.count = self.count + delta;
    }
}

main();

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    8     8 │ <closure new 0x000000000002>
    9     9 │ <bound method incr 0x000000000004>
   10    10 │ <bound method add 0x000000000005>
   11    11 │ <bound method incr 0x000000000006>
   12       │-<bound method add 0x000000000007>
         12 │+<bound method add 0x000000000006>
────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions