From 3e41c7203adc1c7a00fe76c295d2abb8afc2d648 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 27 Dec 2021 14:47:27 +0100 Subject: [PATCH] tests/Symbol/Table/Shared: lookup shared symbols in catalog --- tests/Symbol/Table/Shared.phpt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/Symbol/Table/Shared.phpt b/tests/Symbol/Table/Shared.phpt index 8740f01..4227bdd 100644 --- a/tests/Symbol/Table/Shared.phpt +++ b/tests/Symbol/Table/Shared.phpt @@ -28,7 +28,15 @@ foreach (str_split($buf, 8) as $line) { echo "\n"; $u = new ion\Unserializer\PHP(multiSequence: true); -var_dump($u->unserialize($buf)); +var_dump($s = $u->unserialize($buf)); + +foreach ($s as $sym) { + /** @var ion\Symbol $sym */ + $t = $c->findBest($sym->importLocation->name); + $r = $t->findLocal($sym->importLocation->location); + printf("%s: %s@%d\n", $r->value, $sym->importLocation->name, + $sym->importLocation->location); +} $u = new ion\Unserializer\PHP(multiSequence: true, readerOptions: new ion\Reader\Options( @@ -104,6 +112,10 @@ array(4) { } } } +shared1: shared@1 +shared1: shared@1 +shared2: shared@2 +shared2: shared@2 on_context_change array(4) { [0]=> -- 2.30.2