import { Stack } from "https://deno.land/x/async@v2.0.0/stack.ts";
A stack implementation that allows for adding and removing elements, with optional waiting when popping elements from an empty stack.
import { assertEquals } from "https://deno.land/std@0.186.0/testing/asserts.ts";
import { Stack } from "./stack.ts";
const stack = new Stack<number>();
stack.push(1);
stack.push(2);
stack.push(3);
assertEquals(await stack.pop(), 3);
assertEquals(await stack.pop(), 2);
assertEquals(await stack.pop(), 1);