From aed5242acd1ef0a367a81341c5517cc7ecddcdd1 Mon Sep 17 00:00:00 2001 From: Louis-Marie Givel Date: Wed, 24 Aug 2022 13:20:57 +0200 Subject: [PATCH] Add test showing history bug Change-Id: history_bug --- tests/filter/graphql_history.t | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/filter/graphql_history.t diff --git a/tests/filter/graphql_history.t b/tests/filter/graphql_history.t new file mode 100644 index 000000000..1eff34f68 --- /dev/null +++ b/tests/filter/graphql_history.t @@ -0,0 +1,44 @@ + $ export TESTTMP=${PWD} + + $ cd ${TESTTMP} + $ git init -q repo 1> /dev/null + $ cd repo + + $ echo contents0 > file1 + $ git add . + $ git commit -m "add file1" 1> /dev/null + $ echo contents2 > file2 + $ git add . + $ git commit -m "add file2" 1> /dev/null + $ mkdir ws + $ cat > ws/workspace.josh < ::file2 + > EOF + $ git add . + $ git commit -m "add ws" 1> /dev/null + + $ cat > query < query { + > rev(at: "HEAD", filter: ":workspace=ws") { + > history(limit: 1) { + > summary + > } + > } + > } + > EOF + + $ josh-filter -g "$(cat query)" + {"rev":{"history":[{"summary":"add ws"}]}} + + $ cat > query2 < query { + > rev(at: "HEAD", filter: ":workspace=ws") { + > history(limit: 2) { + > summary + > } + > } + > } + > EOF + + $ josh-filter -g "$(cat query2)" + null